MongoDB 中添加副本集成员错误

Adding Replica Set Members error in MongoDB

我遇到了这样的错误!请告诉我我该怎么办?我完成了 /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
}

IP为192.168.56.101:27017的mongod服务器必须配置replicaSet。

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

mongod --replSet "rs2"