【发布时间】:2014-09-09 12:16:06
【问题描述】:
我正在尝试复制我的 mongodb 数据库,我在我的 windows azure 帐户上创建了 2 个 VM。 它们都是 Ubuntu 14.04。 我已经在它们两个上打开了 27017 端口,并安装了 mongodb 最新版本。 我开始使用 mongo
mongod --port 27017 --dbpath /data/datadrive --replSet rs0
在两台机器上,并使用
添加了另一个成员rs.add("内部 IP 地址:27017")
我一直收到错误消息,说我有两个初选,我在其中一个论坛上阅读 这是因为 /etc/mongodb.conf 中的 bind_ip 配置而发生的 所以我将bind_ip更改为两个VM上的其他VM私有网络IP 在尝试添加服务器成员时出现以下错误。
在“主要”方面:
[rsMgr] not electing self, 100.79.138.73:27017 would veto with 'I don't think reptester1:27017 is electable'
[rsHealthPoll] replset info 100.79.138.73:27017 thinks that we are down
[rsHealthPoll] replset info 100.79.138.73:27017 thinks that we are down
在“次要”方面:
[rsHealthPoll] getaddrinfo("reptester1") failed: Name or service not known
[rsHealthPoll] couldn't connect to reptester1:27017: couldn't connect to server reptester1:27017 (0.0.0.0) failed, address resolved to 0.0.0.0
[rsHealthPoll] replset info reptester1:27017 just heartbeated us, but our heartbeat failed: , not changing state
[rsHealthPoll] getaddrinfo("reptester1") failed: Name or service not known
任何想法我做错了什么?
【问题讨论】:
-
您似乎没有按照说明进行操作。尝试关注basic replica set setup tutorial。可能还有其他网络问题,但是你描述的设置方法也不对。
标签: mongodb azure replication database-replication ubuntu-14.04