Check the Replica Status
rs.status()
Check for Master
db.isMaster()
Demote Primary Replica
rs.stepDown()
Change priority order of Primary and secondaries
cfg = rs.conf()
cfg.members[0].priority = 1
cfg.members[1].priority = 0.5
cfg.members[2].priority = 2
rs.reconfig(cfg)
Check Replication lag
db.printSecondaryReplicationInfo()
db.printReplicationInfo()
Check for Master
db.isMaster()
Rotate the log
db.adminCommand( { logRotate : 1 } )
Shutdown the instance
db.shutdownServer()