0
我想安裝副本集但不成功。副本集配置不兼容
這裏是所有服務器/etc/mongodb.conf配置文件:
security:
keyFile: /opt/svn/mhealth-server-config/etc/mongokey
replication:
replSetName: rs0
這裏是rs.status的結果()主服務器的命令
{
"set" : "rs0",
"date" : ISODate("2017-10-05T08:00:57.599Z"),
"myState" : 1,
"term" : NumberLong(22),
"heartbeatIntervalMillis" : NumberLong(2000),
"optimes" : {
"lastCommittedOpTime" : {
"ts" : Timestamp(1507190457, 90),
"t" : NumberLong(22)
},
"appliedOpTime" : {
"ts" : Timestamp(1507190457, 121),
"t" : NumberLong(22)
},
"durableOpTime" : {
"ts" : Timestamp(1507190457, 90),
"t" : NumberLong(22)
}
},
"members" : [
{
"_id" : 0,
"name" : "......",
"health" : 1,
"state" : 1,
"stateStr" : "PRIMARY",
"uptime" : 1256,
"optime" : {
"ts" : Timestamp(1507190457, 121),
"t" : NumberLong(22)
},
"optimeDate" : ISODate("2017-10-05T08:00:57Z"),
"electionTime" : Timestamp(1507189204, 1),
"electionDate" : ISODate("2017-10-05T07:40:04Z"),
"configVersion" : 1,
"self" : true
}
],
"ok" : 1
}
下一頁,我嘗試將第二臺服務器添加到副本集,它打印以下錯誤消息:
{
"ok" : 0,
"errmsg" : "Our replica set ID of 58fcaf004dd51cd984051968 did not match that of 13.76.170.50:27017, which is 59d3668ea39e555205ab2761",
"code" : 103,
"codeName" : "NewReplicaSetConfigurationIncompatible"
}
它是清除這兩個服務器具有相同的副本集名稱「rs0」,所以我不知道是什麼原因造成的問題。我已閱讀this thread,但它不能解決我的問題。任何幫助深表感謝。
找到一個可能的原因。我已經用replSet = rs1啓動了輔助服務器。不過,我已經適當地更改了配置文件,但它只是無法識別新的replset rs0。我現在不知道如何從輔助服務器清除此設置 –