收到来自与我们具有相同成员 ID 的成员的心跳失败:0 [英] failed with Received heartbeat from member with the same member ID as ourself:0

查看:131
本文介绍了收到来自与我们具有相同成员 ID 的成员的心跳失败:0的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

Trying to set a replica set configuration for 1 primary , 1 slave and 1 arbitrator. I have setup this in the /etc/mongodb.conf

replication:
  replSetName: ProductionReplicaSet

但不小心在三台服务器上运行了 rs.initiate().现在当我运行 rs.add("mongo02....") 我得到:

but accidentally ran rs.initiate() on the three servers. now when I'm running rs.add("mongo02....") i'm getting :

{
    "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() 可以反转,但说明不清楚.

I read here that rs.initiate() can be reversed but the instructions are not clear.

在 mongo02 上试过:

tried on 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
}

有什么帮助吗?我对其他解决方案持开放态度.

any help? i'm open to other solutions.

推荐答案

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

I ran in to this as well. Turns out it can be caused by two things.

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"属性并移动或删除该文件夹中的所有文件.

To resolve this you will need to check /etc/mongod.conf for the "dbPath" attribute and move or remove all the files in that folder.

这篇关于收到来自与我们具有相同成员 ID 的成员的心跳失败:0的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆