Unable to launch mongos

clueless picture clueless · Feb 22, 2017 · Viewed 8.1k times · Source

I am attempting a simple sharding set up (on a single host without any replica set). However I am unable to go any further because this is what happens when i try to start mongos:

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

I get:

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

I am failing to see what is lacking. I tried mongos --help, but according to that valid arguments for --configdb are <config replset name>/<host1:port>, <host2:port>, etc. But this is what I've done.

I have not done anything else than starting the config server:

mongod --configsvr --port 27010

which is the one I am trying to connect the mongos to.

Any ideas on how this can be resolved?

Thankful for any advice in advance.

Answer

Vince Bowdren picture Vince Bowdren · Feb 22, 2017

You have set up the config server as a standalone mongod process, but as of MongoDB 3.4 that isn't supported: it must be a replicaset:

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).

The minimum setup is to have a single mongod process, configured as a 1-member replica set; then your mongos process connects to the replica set:

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