增加Arbiter
增加配置文件mongod1,mongod2,mongod3分別為shard1,shard2,shard3三個set集合的arbiter。
復制代碼 代碼如下:
replSet=shard1
replSet=shard2
replSet=shard3
啟動mongod實例。
連接Primary.
復制代碼 代碼如下:
rs.addArb(“192.168.1.50:10001″)
rs.addArb(“192.168.1.50:10002″)
rs.addArb(“192.168.1.50:10003″)
移除Arbiter
復制代碼 代碼如下:
rs.remove(“192.168.1.50:10001″)
注意:最好移除結點時候先停掉服務,防止有特殊未知狀態出現。
Note:Before running the rs.remove() operation, you must shut down the replica set member that you're removing.
Changed in version 2.2: This procedure is no longer required when using rs.remove(), but it remains good practice.