Posts

Showing posts with the label rs.reconfig

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...