mongodb - 无法为 sharded MongoDB 集群的配置服务器启动副本集
问题描述
我正在按照这个链接部署一个分片集群。正如他们所说,在第一步中,我已经启动了三个单独的 mongod 实例
mongod --configsvr --replSet “cs” --dbpath mongodb/config/config-c --bind_ip localhost --port 57042
mongod --configsvr --replSet “cs” --dbpath mongodb/config/config-c --bind_ip localhost --port 57042
mongod --configsvr --replSet “cs” --dbpath mongodb/config/config-c --bind_ip localhost --port 57042
在第二步之后,当我尝试像他们提到的那样启动副本集时
rs.initiate( { _id: "cs", configsvr: true, members: [ { _id : 0, host : "localhost:57040" }, { _id : 1, host : "localhost:57041" }, { _id : 2, host : "localhost:57042" }]})
我收到一个错误
{
"operationTime" : Timestamp(0, 0),
"ok" : 0,
"errmsg" : "Attempting to initiate a replica set with name cs, but command line reports “cs”; rejecting",
"code" : 93,
"codeName" : "InvalidReplicaSetConfig",
"$gleStats" : {
"lastOpTime" : Timestamp(0, 0),
"electionId" : ObjectId("000000000000000000000000")
},
"lastCommittedOpTime" : Timestamp(0, 0),
"$clusterTime" : {
"clusterTime" : Timestamp(0, 0),
"signature" : {
"hash" : BinData(0,"AAAAAAAAAAAAAAAAAAAAAAAAAAA="),
"keyId" : NumberLong(0)
}
}
}
为什么我会收到此错误?如何解决这个问题?
解决方案
推荐阅读
- shell - 如何剪切字符串并将其发送到“cd”命令
- c# - 程序如何知道数组达到 10?
- python - pyflann 代码比 C++ FLANN 快得多
- java - 我将如何通过 Java 属性为 AWS Parameter Store Spring 属性源公开 AWS 凭证
- sql - 如果 SQL Server 查询中存在值,如何添加过滤器?
- javascript - 无法读取 null 的属性值
- sql - 从每个类别中选择 n 个样本
- go - Golang:如何使用 vgo?错误:“找不到包”
- swift - put 不是 StorageReference 的成员,它的类型值
- javascript - 将带参数的函数作为参数传递,但哪个接受调用函数的参数?