MongoDB获取命令行启动参数getCmdLineOpts

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



Posted

in

by

Tags:

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *