标签:remove ber priority stp str mongo ini admin dmi
mongo副本集搭建
任意一台:
>use admin
>cfg={ _id:"mongo-repl", members:[
{_id:0,host:‘192.168.32.101:27017‘,priority:2},
{_id:1,host:‘192.168.32.102:27017‘,priority:1},
{_id:2,host:‘192.168.32.101:27018‘,arbiterOnly:true}]}
初始化副本集:rs.initiate(cfg)
需要做主库上操作:
use admin
cfg={ _id:"mongo-repl", members:[
{_id:0,host:‘192.168.32.101:27017‘,priority:2},
{_id:1,host:‘192.168.32.102:27017‘,priority:1},
{_id:2,host:‘192.168.32.101:27018‘,arbiterOnly:true}]}
重建副本集:rs.reconfig(cfg)
删除一个节点:rs.remove("192.168.32.102:27017")
添加一个节点:rs.add(hostportstr)
标签:remove ber priority stp str mongo ini admin dmi
原文地址:http://www.cnblogs.com/youhunyimeng/p/6407550.html