MongoDB获取命令行启动参数的方法; 有时候希望知道启动mongd的启动参数,可以使用如下命令获得:
use admin db.runCommand("getCmdLineOpts") 例如 > use admin switched to db admin > db.runCommand("getCmdLineOpts") { "argv" : [ "/usr/local/opt/mongodb/bin/mongod", "--config", "/usr/local/etc/mongod.conf" ], "parsed" : { "config" : "/usr/local/etc/mongod.conf", "net" : { "bindIp" : "127.0.0.1" }, "storage" : { "dbPath" : "/usr/local/var/mongodb" }, "systemLog" : { "destination" : "file", "logAppend" : true, "path" : "/usr/local/var/log/mongodb/mongo.log" } }, "ok" : 1
Comment