2012年3月19日 星期一

Replica Set Commands - MongoDB

Replica Set Commands - MongoDB:

rs.help() show help
rs.status() { replSetGetStatus : 1 }
rs.initiate() { replSetInitiate : null } initiate
with default settings
rs.initiate(cfg) { replSetInitiate : cfg }
rs.add(hostportstr) add a new member to the set
rs.add(membercfgobj) add a new member to the set
rs.addArb(hostportstr) add a new member which is arbiterOnly:true
rs.remove(hostportstr) remove a member (primary, secondary, or arbiter) from the set
rs.stepDown() { replSetStepDown : true }
rs.conf() return configuration from local.system.replset
db.isMaster() check who is primary

沒有留言:

張貼留言