第四步 初始化复本集:
ctrl+alt+f4进入控制台4打开mongodb的shell
./mongo --port 28010
config_replset1 =
{
_id:"replset1",
members:
[ {_id:0,host:"192.168.0.188:28010",priority:4},
{_id:1,host:"192.168.0.188:28011",priority:2},
{_id:2,host:"192.168.0.188:28012",arbiterOnly : true}
]
}
注意arbiter仲裁节点只投票,不接收复制的数据!
rs.initiate(config_replset1);
可以用rs.status()查看集群状况:
|