The dbpath of the .conf file doesn't match folder data

Hello there,

One of my client have a cluster. In one of the secondary there are all of the data, database and collection but the path of this folder doesn’t match what is in the .conf file

There is any chance to know why a .conf file like this

dbpath: /var/lib/mongodb

doesn’t containt what I’m looking for?

How can I find the information about the folder data. Maybe there is another .conf file with another name that is used by mongod process?
There is only one mongod process that use the above mentioned .conf file and there aren’t any other mongod processes.
I tried to investigate into another secondary but I didn’t find anything.

Any help will be appreciated.

How was your mongod started?
As a service or from command line?
If started from command line ps --ef|grep mongod will show some details
Check mongod.log on each node.It will show the parameters that was used at startup
or run
db.adminCommand( { getCmdLineOpts: 1 } ) if you are connected to db

Thank you for your reply, it was very helpful.

My first question was because we had an issue with one secondary that suddenly the size of indexes started to growth abnormally until almost of the free space in the file system it runs out.

We tried to re-sync the secondary in the Ops Manager dashboard but after about 10 hours the mongod process has crashed.

Then to restore the synchronization between the primary and secondary we’re going to do the following:

  • backup of the folder data from secondary server A where the mongod process is currently down
  • remove all of the data in the folder data from secondary server A
  • copy the folder data from a secondary server B to the empty folder data of the secondary server A
  • restart the mongod process on secondary server A

From your point of view is a rigth way to restore the data get (copy) from a good secondary server, issued in the command prompt and get synchronized with the primary or there could be an alternative solution that it takes less effort and risks to lose data?

Thank you in advance.

Yes copy from good secondary is faster but make sure datafiles are recent to catch with oplog
Refer to option 2 in this link

Thank you for your reply.