首页 > 数据库 > MongoDB > 正文

Mongodb增加、移除Arbiter节点实例

2020-07-28 14:14:48
字体:
来源:转载
供稿:网友

增加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.

发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表