我正在尝试为mongodb分片群集初始化配置副本集。我正在最后一步初始化集群,但无法这样做。我收到以下错误消息:
"ok" : 0,
"errmsg" : "No host described in new configuration 1 for replica set RESATLMONGOCON maps to this node",
"code" : 93,
"codeName" : "InvalidReplicaSetConfig",
"operationTime" : Timestamp(0, 0),
"$gleStats" : {
"lastOpTime" : Timestamp(0, 0),
"electionId" : ObjectId("000000000000000000000000")
},
"$clusterTime" : {
"clusterTime" : Timestamp(0, 0),
"signature" : {
"hash" : BinData(0,"AAAAAAAAAAAAAAAAAAAAAAAAAAA="),
"keyId" : NumberLong(0)
}
}
我尝试将更多IP地址添加到--bind_ip,我从bind_ip中删除了localhost,并且还尝试了全部删除bind_ip选项。没有工作。我正在通过命令行运行它。下面列出了我在每台服务器上运行的命令以及rs.initialize()。任何帮助将不胜感激。
sudo mongod --configsvr --replSet rs0 --dbpath /data/db --bind_ip localhost,172.30.20.4:27019
sudo mongod --configsvr --replSet rs0 --dbpath /data/db --bind_ip localhost,172.30.20.5:27019
sudo mongod --configsvr --replSet rs0 --dbpath /data/db --bind_ip localhost,172.30.20.6:27019
rs.initiate(
{
_id: "rs0",
configsvr: true,
members: [
{ _id : 0, host : "172.30.20.4:27019" },
{ _id : 1, host : "172.30.20.5:27019" },
{ _id : 2, host : "172.30.20.6:27019" }
]
}
)
我只是想将此群集的配置虚拟机获取到副本集中。
任何帮助将不胜感激。