这篇文档主要介绍MongoDB副本集的日常查看和管理的命令.
1)命令行的查看命令:db.serverCmdLineOpts()
点击(此处)折叠或打开
arps:SECONDARY> db.serverCmdLineOpts()
{
"argv" : [
"/opt/software/mongodb-linux-x86_64-3.0.1/bin/mongod",//启动参数mongod
"-f",
"/opt/software/mongodb-linux-x86_64-3.0.1/bin/mongodb.conf"
],//参数配置文件
"parsed" : {
"config" : "/opt/software/mongodb-linux-x86_64-3.0.1/bin/mongodb.conf",
"net" : {
"port" : 27017 //端口
},
"processManagement" : {
"fork" : true,
"pidFilePath" : "/opt/data/mongodb/mongodb.pid" //进程文件
},
"replication" : {
"oplogSizeMB" : 10000, //oplog日志大小
"replSet" : "arps" //副本集的名称arps
},
"storage" : {
"dbPath" : "/opt/data/mongodb", //数据存储的位置
"directoryPerDB" : true,
"mmapv1" : {
"preallocDataFiles" : false
}
},
"systemLog" : {
"destination" : "file",
"logAppend" : true,
"path" : "/opt/data/mongodb/log/mongodb.log" //系统日志的位置
}
},
"ok" : 1
}
{
"argv" : [
"/opt/software/mongodb-linux-x86_64-3.0.1/bin/mongod",//启动参数mongod
"-f",
"/opt/software/mongodb-linux-x86_64-3.0.1/bin/mongodb.conf"
],//参数配置文件
"parsed" : {
"config" : "/opt/software/mongodb-linux-x86_64-3.0.1/bin/mongodb.conf",
"net" : {
"port" : 27017 //端口
},
"processManagement" : {
"fork" : true,
"pidFilePath" : "/opt/data/mongodb/mongodb.pid" //进程文件
},
"replication" : {
"oplogSizeMB" : 10000, //oplog日志大小
"replSet" : "arps" //副本集的名称arps
},
"storage" : {
"dbPath" : "/opt/data/mongodb", //数据存储的位置
"directoryPerDB" : true,
"mmapv1" : {
"preallocDataFiles" : false
}
},
"systemLog" : {
"destination" : "file",
"logAppend" : true,
"path" : "/opt/data/mongodb/log/mongodb.log" //系统日志的位置
}
},
"ok" : 1
}