Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

what is /data/configdb path used for in mongodb?

Tags:

docker

mongodb

I am running a docker of mongodb, and notice a volume created and mounted to /data/configdb. this is in addition to another volume mapped to /data/db which I know is where my actual data is stored.

I am trying to find out what is stored in /data/configdb, and searched google for it. surprisingly enough I didn't find anything explaining what is stored there.

what is stored there (/data/configdb), and can it be discarded everytime I restart my mongodb container?

like image 723
GKman Avatar asked Jul 02 '19 15:07

GKman


People also ask

Where is MongoDB data stored?

The default location for the MongoDB data directory is c:\data\db. So you need to create this folder using the Command Prompt.

What is config db in MongoDB?

Starting in MongoDB 3.6, the config database contains the internal collections to support causally consistent sessions for standalones, replica sets, and sharded clusters and retryable writes and transactions for replica sets and sharded clusters.


1 Answers

To summarize from the docs, config servers store the metadata for a sharded cluster, and /data/configdb is the default path where a config server stores its data files. So if you're not dealing with sharded clusters, removing any references to it should be ok.

From the docs:

--configsvr

Declares that this mongod instance serves as the config server of a sharded cluster. When running with this option, clients (i.e. other cluster components) will not be able to write data to any database other than config and admin. The default port for a mongod with this option is 27019 and the default --dbpathdirectory is /data/configdb, unless specified.

References:

https://docs.mongodb.com/manual/core/sharded-cluster-config-servers/

https://docs.mongodb.com/v3.4/reference/program/mongod/#cmdoption-configsvr

Hope this helps!

like image 158
cisco Avatar answered Nov 15 '22 02:11

cisco