Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/mongodb/11.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Mongodb 接收到来自与自己具有相同成员ID的成员的检测信号失败:0_Mongodb - Fatal编程技术网

Mongodb 接收到来自与自己具有相同成员ID的成员的检测信号失败:0

Mongodb 接收到来自与自己具有相同成员ID的成员的检测信号失败:0,mongodb,Mongodb,正在尝试为1个主、1个从和1个仲裁器设置副本集配置。 我已经在/etc/mongodb.conf replication: replSetName: ProductionReplicaSet 但意外地在三台服务器上运行了rs.initiate()。现在,当我运行rs.add(“mongo02….”)时,我得到: { "ok" : 0, "errmsg" : "Quorum check failed because not enough voting nodes respon

正在尝试为1个主、1个从和1个仲裁器设置副本集配置。 我已经在
/etc/mongodb.conf

replication:
  replSetName: ProductionReplicaSet
但意外地在三台服务器上运行了
rs.initiate()
。现在,当我运行
rs.add(“mongo02….”)
时,我得到:

{
    "ok" : 0,
    "errmsg" : "Quorum check failed because not enough voting nodes responded; required 2 but only the following 1 voting nodes responded: chef-production2-mongo01:27017; the following nodes did not respond affirmatively: mongo02...:27017 failed with Received heartbeat from member with the same member ID as ourself: 0",
    "code" : 74
}
我在这里读到,
rs.initiate()
可以反转,但说明不清楚

在mongo02上试用:

config = rs.config() //config with _id :0
config["members"][0]["_id"] = 1 
rs.reconfig(config)
{
    "ok" : 0,
    "errmsg" : "New and old configurations both have members with host of chef-production2-mongo02:27017 but in the new configuration the _id field is 1 and in the old configuration it is 0 for replica set ProductionReplicaSet",
    "code" : 103
}

有什么帮助吗?我对其他解决办法持开放态度

我也遇到了这个问题。事实证明,这可能是由两件事引起的

1.  If the node you are adding already has its own dbData.  

2.  If you ran rs.initiate() on both nodes.   It is only supposed to be run on the primary.
要解决此问题,您需要检查/etc/mongod.conf中的“dbPath”属性,并移动或删除该文件夹中的所有文件