Running a sharded cluster with fewer than 3 config servers. Are we supposed to put in all 3?

Hi,

Is it supposed to recognize all 3 or is something wrong with the config file?

vagrant@m103:~$ mongos -f /var/mongodb/db/mongos.conf
2019-04-27T06:36:11.766+0000 W SHARDING [main] Running a sharded cluster with fewer than 3 config servers should only be done for testing purposes and is not recommended for production.
about to fork child process, waiting until server is ready for connections.
forked process: 7550
child process started successfully, parent exiting

vagrant@m103:~/scripts$ cat /var/mongodb/db/mongos.conf
sharding:
configDB: m103-csrs/192.168.103.100:26001
security:
keyFile: /var/mongodb/pki/m103-keyfile
net:
bindIp: localhost,192.168.103.100
port: 26000
systemLog:
destination: file
path: /var/mongodb/db/mongos.log
logAppend: true
processManagement:
fork: true

vagrant@m103:~/scripts$ cat /var/mongodb/db/1/csrs_1.conf
sharding:
clusterRole: configsvr
replication:
replSetName: m103-csrs
security:
keyFile: /var/mongodb/pki/m103-keyfile
net:
bindIp: localhost,192.168.103.100
port: 26001
systemLog:
destination: file
path: /var/mongodb/db/csrs1/mongod.log
logAppend: true
processManagement:
fork: true
storage:
dbPath: /var/mongodb/db/csrs1
vagrant@m103:~/scripts$ cat /var/mongodb/db/2/csrs_2.conf
sharding:
clusterRole: configsvr
replication:
replSetName: m103-csrs
security:
keyFile: /var/mongodb/pki/m103-keyfile
net:
bindIp: localhost,192.168.103.100
port: 26002
systemLog:
destination: file
path: /var/mongodb/db/csrs2/mongod.log
logAppend: true
processManagement:
fork: true
storage:
dbPath: /var/mongodb/db/csrs2
vagrant@m103:~/scripts$ cat /var/mongodb/db/3/csrs_3.conf
sharding:
clusterRole: configsvr
replication:
replSetName: m103-csrs
security:
keyFile: /var/mongodb/pki/m103-keyfile
net:
bindIp: localhost,192.168.103.100
port: 26003
systemLog:
destination: file
path: /var/mongodb/db/csrs3/mongod.log
logAppend: true
processManagement:
fork: true
storage:
dbPath: /var/mongodb/db/csrs3
vagrant@m103:~/scripts$

May be your mongos is not correctly configured to use the entire csrs cluster
3 mongods and
3 config servers and one mongos should be up and running for sharding
Can you please check your config/setup

Thanks. I thought you didn’t have to? :slight_smile:
I thought all crs having the replica name being the same will suit.

I corrected mongos.conf and re-started and now I can’t connect at all to any port? :frowning:
I have tried re-starting everything and it is still the same.
Not sure what else to do :frowning:

vagrant@m103:~/scripts$ mongo --port 26000 -u “m103-adm” -p “m103-admin” --authenticationDatabase admin
MongoDB shell version v3.6.12
connecting to: mongodb://127.0.0.1:26000/?authSource=admin&gssapiServiceName=mongodb
2019-04-28T07:52:58.153+0000 E QUERY [thread1] Error: Authentication failed. :
connect@src/mongo/shell/mongo.js:263:13
@(connect):1:6
exception: connect failed
vagrant@m103:~/scripts$ mongo --port 26001 -u “m103-adm” -p “m103-admin” --authenticationDatabase admin
MongoDB shell version v3.6.12
connecting to: mongodb://127.0.0.1:26001/?authSource=admin&gssapiServiceName=mongodb
2019-04-28T07:53:20.944+0000 E QUERY [thread1] Error: Authentication failed. :
connect@src/mongo/shell/mongo.js:263:13
@(connect):1:6
exception: connect failed
vagrant@m103:~/scripts$ mongo --port 26002 -u “m103-adm” -p “m103-admin” --authenticationDatabase admin
MongoDB shell version v3.6.12
connecting to: mongodb://127.0.0.1:26002/?authSource=admin&gssapiServiceName=mongodb
2019-04-28T07:53:26.859+0000 E QUERY [thread1] Error: Authentication failed. :
connect@src/mongo/shell/mongo.js:263:13
@(connect):1:6
exception: connect failed
vagrant@m103:~/scripts$ mongo --port 26003 -u “m103-adm” -p “m103-admin” --authenticationDatabase admin
MongoDB shell version v3.6.12
connecting to: mongodb://127.0.0.1:26003/?authSource=admin&gssapiServiceName=mongodb
2019-04-28T07:53:31.547+0000 E QUERY [thread1] Error: Authentication failed. :
connect@src/mongo/shell/mongo.js:263:13
@(connect):1:6
exception: connect failed
vagrant@m103:~/scripts$ mongo --port 27001 -u “m103-adm” -p “m103-admin” --authenticationDatabase admin
MongoDB shell version v3.6.12
connecting to: mongodb://127.0.0.1:27001/?authSource=admin&gssapiServiceName=mongodb
2019-04-28T07:53:40.168+0000 E QUERY [thread1] Error: Authentication failed. :
connect@src/mongo/shell/mongo.js:263:13
@(connect):1:6
exception: connect failed
vagrant@m103:~/scripts$
vagrant@m103:~/scripts$

Ooops, sorry my bad wrong username :slight_smile: