无法启动 mongos

Unable to launch mongos

我正在尝试进行简单的分片设置(在没有任何副本集的单个主机上)。但是我无法继续下去,因为这是我尝试启动 mongos 时发生的情况:

C:\>mongos --configdb localhost:27010 --port 27011

我得到:

BadValue: configdb supports only replica set connection string  
try 'mongos --help' for more information   

我看不出缺少什么。我尝试了 mongos --help,但根据 --configdb 的有效参数是 <config replset name>/<host1:port>, <host2:port>, etc。但这就是我所做的。

除了启动配置服务器,我没有做任何其他事情:

mongod --configsvr --port 27010

这是我试图将 mongos 连接到的那个。

关于如何解决这个问题有什么想法吗?

感谢您提前提出任何建议。

您已将配置服务器设置为独立的 mongod 进程,但从 MongoDB 3.4 开始不受支持:它必须 是一个副本集:

config servers: Config servers store metadata and configuration settings for the cluster. As of MongoDB 3.4, config servers must be deployed as a replica set (CSRS).

最小设置是有一个 mongod 进程,配置为 1-member replica set;然后你的 mongos 进程连接到副本集:

mongos --configdb replsetname/localhost:27010 --port 27011