在MongoDB中添加副本集成员错误

时间:2017-12-06 05:09:01

标签: mongodb replicaset

我得到这样的错误!请告诉我该怎么办?我完成了编辑/ etc / hosts与我将添加到主要的那个!但它显示为下面的错误!

rs2:PRIMARY> rs.add("192.168.56.101:27017")
{
    "ok" : 0,
    "errmsg" : "Quorum check failed because not enough voting nodes responded; required 2 but only the following 1 voting nodes responded: 192.168.56.104:27017; the following nodes did not respond affirmatively: 192.168.56.101:27017 failed with Connection refused",
    "code" : 74
}

1 个答案:

答案 0 :(得分:1)

IP 192.168.56.101:27017的mongod服务器必须配置副本集。

使用replicaSet选项在192.168.56.101:27017上启动mongod,如:

mongod --replSet "rs2"