How to check the current configuration of MongoDB

2020-05-25 03:31发布

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?

2条回答
爷的心禁止访问
2楼-- · 2020-05-25 04:08

to get live settings, you can use

db._adminCommand({getParameter:"*"})

https://docs.mongodb.com/manual/reference/command/getParameter/

查看更多
Explosion°爆炸
3楼-- · 2020-05-25 04:18

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})
查看更多
登录 后发表回答