Mongo DB service getting stopped intermittently - mongodb

We have installed Mongo DB (v4.4.8) on our Windows Server 2016.
But the Mongo DB service stops very frequently, then we have to start the service again, which will run for few mins (varies from less than a minute to 10 mins), then will stop again. Sometimes the service will stop immediately.
We are able to access the DB and create collection when it is running.
I can see a folder that does not exist in our server in the Mongo DB logs.
{"t":{"$date":"2021-09-14T16:55:22.194+02:00"},"s":"I", "c":"CONTROL", "id":31445, "ctx":"ftdc","msg":" Frame: {frame}","attr":{"frame":{"a":"7FF6F29F14EC","module":"mongod.exe","file":"C:/Program Files (x86)/Microsoft Visual Studio/2019/Professional/VC/Tools/MSVC/14.26.28801/include/thread","line":44,"s":"std::thread::_Invokestd::tuple<<lambda_726633d7e71a0bdccc2c30a401264d8c >,0>","s+":"2C"}}}
The account with which we run the Mongo DB service is added as an Administrator on the server.
Can someone help me with this.

Security tools were blocking Mongo DB files, due to which the service was keep on stopping intermittently because the files were not accessible for the Mongo DB service. Finally we had to exclude the Mongo DB folders from the security scanning to make it work temporarily.

Related

I am not able to start MongoDB ON WINDOWS 10

Mongod is not starting on windows 10 it shows 'access control is not enabled for the database. Read and write access to data and configuration is unrestr 10.
Mongo is started and is running. This message is simply a notice, not an error. It says that your Mongo database is insecure because anyone is able to read and write. This is fine for your development purposes on your computer, but you should change the settings if you use Mongo for a production, customer-facing website.

MongoDB restore from file backup

I have a backup of /data/db that contains all .wt files along with journal directory etc. I have stopped the db, replaced the current db directory with the one backed up and started the db. This works, Mongo starts up but when I "show databases" there are no results. The local machine (that was backed up) did not have authentication enabled. The machine I am using to attempt the restore does have it enabled, I am able to start the mongo client without any authentication.
Is there another step to this process?
Is the authentication difference an issue?

Use mongodb data/db data files for restore

Our server is down and have no backups on our dbs. But we were able to get data/db using WinSCP. It would be fortunate if we could use these data files to restore our dbs. I have tried setup mongodb in other server and copied data/db from failed server. As I started mongod instance in the new server it says a compatibility issue with authentication schema that data files from data/db was. So we cannot start mongod. I wonder if there's a work around so we can start a mongod with the old data/db from failed server? Or other way to restore dbs? Thank you very much.

Mongodb connecting to a database with old data when connecting through mongo --host

I have a instance running mongodb. I have used a config file while starting the database using mongod -f mongod.conf. I can connect to this mongodb instance from my application server instance. Recently, due to a software upgrade I had to restart the system. After that, I have been facing the following issue:
When I connect to the mongodb instance using mongo from the database instance(locally), it connects me to the proper database with the latest data. But, when I try to connect it from application server instance using mongo --host "ip_address", it is connecting to the same database but it showing the data which is some days old. I needed to know what the issue is and how will I be able to fetch the latest data which is residing in the database from the application server instance.

MongoDB Error: "not authorized for query on admin.system.users"

How to setup authentication on MongoDB using the following configuration ?
2 mongoD instances, sharded collections.
1 mongoS instance on another server.
1 mongoD as a config server.
Whenever a turn on auth on mongod, i'm not enabled to logon on any servers, the users are created but i still can't login. The following error appear when trying to logon on mongoS instance:
$err: "not authorized for query on admin.system.users"
If you have a problem like I had it is likely that you could not query anything (with similar messages that you are not authorized).
By accident I noticed if I run two different versions of mongo daemon (win7/ent) second daemon starts but does not care if other mongo is listening, so it is unclear which daemon takes requests.
When I stopped all daemons and started one, everything started working. (for me)