mongodb 如何检查MongoDB的当前配置

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/22695367/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-09 13:38:46  来源:igfitidea点击:

How to check the current configuration of MongoDB

mongodbconfiguration

提问by Matt Woelk

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?

有没有办法查看设置了哪些选项,或者至少使用了哪个配置文件?

回答by Matt Woelk

Found the answer: https://stackoverflow.com/a/9361047/947305

找到答案:https: //stackoverflow.com/a/9361047/947305

There's a getCmdLineOptscommand in the mongo shell. Run the following:

mongo shell 中有一个getCmdLineOpts命令。运行以下命令:

db._adminCommand( {getCmdLineOpts: 1})

回答by Lukas Liesis

to get live settings, you can use

要获得实时设置,您可以使用

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

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

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

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