Skip to main content

Posts

Showing posts from September, 2016

Reconfigiure replica set member

Reconfigure replica set member with same coonfiguration as it was earlier: We have replica set of three node cluster.  1 Primary  P1:27001 2 Secondary S1:27002 and S2:27003 S1 server got crashed and need to rebuilt so mongoDB reconfiguration  required. Status at primary looks like this: "set" : "rep1A",         "myState" : 1,         "syncingTo" : "P1:27001",        "members" : [                 {                         "_id" : 0,                         "name" : "P1:27001",             ...

Mongod log is growing too large.

We have log append true in config file. Every day log is appended to the single log file. We are facing issue in space and we were also not able to purge the log file completely. So we need logs file for every day, if we have space issue then we can remove the old logs. Only thing we need to do is: In config file make sure we have: logappend = true Then login to mongo shell, run the below command against the admin database. use admin db.runCommand({logRotate:1})