MongogoDB副本设置在EC2上

时间:2016-07-24 22:01:23

标签: mongodb amazon-ec2

我设置了mongodb配置文件(IP是实际的数字IP

bindIp: [127.0.0.1,external_Ip]

replication:
  replSetName: "rs0"

并在另外两台服务器上做到了。

rs.addArb('ArbIP:27017') 

执行没问题

rs0:PRIMARY> rs.add('54.183.186.123:27017')
2016-07-23T09:03:22.238+0000 E QUERY    [thread1] Error: error doing query: failed: network error while attempting to run command 'count' on host '127.0.0.1:27017'  :
DB.prototype.runCommand@src/mongo/shell/db.js:135:1
DB.prototype.runReadCommand@src/mongo/shell/db.js:112:16
DBQuery.prototype.count@src/mongo/shell/query.js:367:15
DBCollection.prototype.count@src/mongo/shell/collection.js:1713:12
rs.add@src/mongo/shell/utils.js:1143:1
@(shell):1:1

2016-07-23T09:03:22.239+0000 I NETWORK  [thread1] trying reconnect to 127.0.0.1:27017 (127.0.0.1) failed
2016-07-23T09:03:22.240+0000 I NETWORK  [thread1] reconnect 127.0.0.1:27017 (127.0.0.1) ok
rs0:SECONDARY>

出了什么问题,我该如何解决? 我不知道您可能需要哪些其他信息来帮助我,所以请问。

0 个答案:

没有答案