Posts

Showing posts with the label config

MongoDB tips: get config information

db._adminCommand( {getCmdLineOpts: 1}) db._adminCommand({getParameter:"*"}) rs0:PRIMARY> db._adminCommand( {getCmdLineOpts: 1}) {         "argv" : [                 "mongod",                 "--config=/data/configdb/mongod.conf",                 "--dbpath=/data/db",                 "--replSet=rs0",                 "--port=27017",                 "--bind_ip=0.0.0.0",                 "--auth",                 "--keyFile=/data/configdb/key.txt"         ],         "parsed" : {                 "config" : "/data/configdb/mongod.conf",       ...

MongoDB tip: issue with specifying localhost in replica set configuration

Often time when we want to quickly spin up a demo mongodb replica set, we would simply use the localhost:port to specify the nodes assuming all members are on the same server. Here is an quick example why that's not a good practice Here is the output of my current rs.status() MongoDB Enterprise biDemo:PRIMARY> conf= rs.conf() {         "_id" : "biDemo",         "version" : 5,         "protocolVersion" : NumberLong(1),         "members" : [                 {                         "_id" : 0,                         "host" : "localhost:31111",                         "arbiterOnly" : false,                         "b...