Mongodb “mongos错误”;不支持镜像配置服务器连接";
这有什么问题吗Mongodb “mongos错误”;不支持镜像配置服务器连接";,mongodb,Mongodb,这有什么问题吗 $ sudo mongos --logpath "mongos-1.log" --configdb localhost:57040,localhost:57041,localhost:57042 --fork FailedToParse: mirrored config server connections are not supported; for config server replica sets be sure to use the replica set
$ sudo mongos --logpath "mongos-1.log" --configdb localhost:57040,localhost:57041,localhost:57042 --fork
FailedToParse: mirrored config server connections are not supported; for config server replica sets be sure to use the replica set connection string
try 'mongos --help' for more information
我遇到了与您只需将
--configdb更新为“repSetConfigName/localhost:57040,localhost:57041,localhost:57042”相同的问题。
以下是一个例子:
这是我对配置服务器的配置:
mongod --configsvr --dbpath cfg0 --replSet conf --port 27050 --fork --logpath log.cfg0 --logappend
mongod --configsvr --dbpath cfg1 --replSet conf --port 27051 --fork --logpath log.cfg1 --logappend
mongod --configsvr --dbpath cfg2 --replSet conf --port 27052 --fork --logpath log.cfg2 --logappend
然后我用
# connect to any of the mongod process on port 27050, 27051, 27052
mongo --port 27050
rs.initiate(
{
_id: "conf",
configsvr: true,
members: [
{ _id : 0, host : "localhost:27050" },
{ _id : 1, host : "localhost:27051" },
{ _id : 2, host : "localhost:27052" }
]
}
)
最终
mongos --configdb "conf/localhost:27050,localhost:27051,localhost:27052" --fork --logpath log.mongos0 --port 27200
只是@sylia baraka答案的附录。。。如果您正在使用MongoDB 3.4或更新版本,则需要使用CSR而不是SCCC,请阅读更多信息 在版本3.4中,MongoDB取消了对SCCC配置服务器的支持。在将分片集群升级到3.4之前,必须将配置服务器从SCCC转换为CSR。要转换为CSR,请按照以下步骤将3.2.x SCCC更改为3.2.x CSR
configdb应该是这样的: 您的\u replSetName/host:port,host:port,host:port
这个问题真正属于哪个站点用于数据库管理和配置问题。StackOverflow仅适用于编程主题,而此问题不适用于编程主题。请通过删除和重新发布将您的问题移动到正确的站点。