I've found documentation for the different configuration options, but how can I check which options are being used on a live system?
Is there a way to see which options were set, or at minimum which configuration file is being used?
dbPath is /var/lib/mongodb; this setting specifies where MongoDB should store its files. systemLog. path is /var/log/mongodb/mongod. log; this is the path where mongod will write its output.
Following are some of the commands which can be used to get the status of Mongodb: service mongod status: Displays the status of MongodB service as like the screenshot given below. systemctl status mongod: Displays the same status of MongoDB service as like above command as shown in figure 1.
If you want to check your databases list, use the command show dbs. Your created database (mydb) is not present in list. To display database, you need to insert at least one document into it. In MongoDB default database is test.
Found the answer: https://stackoverflow.com/a/9361047/947305
There's a getCmdLineOpts command in the mongo shell. Run the following:
db._adminCommand( {getCmdLineOpts: 1})
to get live settings, you can use
db.adminCommand({getParameter:"*"})
previously called _adminCommand with underscore in front, so if you have old mongo running, try that one.
https://docs.mongodb.com/manual/reference/command/getParameter/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With