【发布时间】:2014-11-25 20:48:11
【问题描述】:
我有一个原型,我在其中创建了一个包含 3 个成员的副本集。现在我想从副本集中删除 2 个辅助节点,并在每个辅助节点上创建新副本。
从初级开始,我做了以下事情:
rs.remove("mongohost2.domain.org:27017")
rs.remove("mongohost3.domain.org:27017")
然后,当我尝试 rs.status() 时,它正确地只显示了集合中的主节点。
现在,在 secondary2.domain.org 框上,我做了以下操作:
- 更改了 mongo.conf 文件 - 将副本集名称从旧的 (jls0) 更改为 jls1。
- 在盒子上重新启动了 mongod。
问题:
当我启动 shell 时,我可以说它没有创建副本集,因为提示没有像以前那样具有副本的名称。
这是我得到的:
me@mongohost2:~$ mongo
MongoDB shell version: 2.6.5
connecting to: test
> rs.status()
{
"startupStatus" : 1,
"ok" : 0,
"errmsg" : "loading local.system.replset config (LOADINGCONFIG)"
}
> rs.initiate()
{
"ok" : 0,
"errmsg" : "local.oplog.rs is not empty on the initiating member. cannot initiate."
}
>
我在日志中发现了这个:
2014-11-25T15:11:38.876-0500 [initandlisten] waiting for connections on port 27017
2014-11-25T15:11:38.957-0500 [rsStart] warning: Failed to connect to 10.238.59.71:27017, reason: errno:111 Connection refused
2014-11-25T15:11:38.961-0500 [rsStart] replSet REMOVED
2014-11-25T15:11:38.961-0500 [rsStart] replSet info self not present in the repl set configuration:
2014-11-25T15:11:38.961-0500 [rsStart] { _id: "jls0", version: 8, members: [ { _id: 0, host: "mongohost1:27017", priority: 3.0 }, { _id: 2, host: "mongohost3.domain.org:27017" } ] }
2014-11-25T15:11:38.964-0500 [rsStart] warning: Failed to connect to 10.238.59.71:27017, reason: errno:111 Connection refused
2014-11-25T15:11:38.964-0500 [rsStart] replSet info Couldn't load config yet. Sleeping 20sec and will try again.
2014-11-25T15:11:39.237-0500 [initandlisten] connection accepted from 10.238.59.141:39443 #1 (1 connection now open)
2014-11-25T15:11:39.237-0500 [conn1] replSet set names do not match, our cmdline: jls1
2014-11-25T15:11:39.237-0500 [conn1] replSet s: jls0
2014-11-25T15:11:58.967-0500 [rsStart] warning: Failed to connect to 10.238.59.71:27017, reason: errno:111 Connection refused
2014-11-25T15:11:58.967-0500 [rsStart] replSet info Couldn't load config yet. Sleeping 20sec and will try again.
2014-11-25T15:11:59.241-0500 [conn1] replSet set names do not match, our cmdline: jls1
2014-11-25T15:11:59.241-0500 [conn1] replSet s: jls0
我还需要执行哪些其他步骤来确保此服务器现在使用它自己的副本集? 谢谢。
【问题讨论】:
标签: mongodb