Problem in deploy a sharded cluster

user@M103# mongod -f mongos.conf
about to fork child process, waiting until server is ready for connections.
forked process: 825
ERROR: child process failed, exited with error number 100
To see additional information in this output, start without the “–fork” option.
user@M103# mongos -f mongos.conf
BadValue: error: no args for --configdb
try ‘mongos --help’ for more information

Check your configdb parameter.You have to pass list of your config servers

1 Like

user@M103# mongod -f csrs.conf
Error reading config file: No such file or directory
try ‘mongod --help’ for more information

user@M103# use config
bash: use: command not found

Use DB works at mongo prompt not at os prompt
Your previous command fails if you are in a different directory
Can you see the csrs.conf?

mongod --replSet m103-csrs --keyFile /var/mongodb/pki/m103-keyfile --port 26000 --auth --logpath /var/mongodb/logs/mongos.log --fork
about to fork child process, waiting until server is ready for connections.
forked process: 824
ERROR: child process failed, exited with error number 100
To see additional information in this output, start without the “–fork” option.
user@M103#

Mongos should be started with mongos not mongod
Try to use config file.It is easy and convenient
Are you trying to start config server or mongos?
Please check your lesson or mongo documentation for the commands/params to be used for each type

user@M103# mongo --port 26000 --username m103-admin --password m103-pass --authenticationDatabase admin
MongoDB shell version v4.0.5
connecting to: mongodb://127.0.0.1:26000/?authSource=admin&gssapiServiceName=mongodb
2022-09-23T16:44:12.511+0000 E QUERY [js] Error: couldn’t connect to server 127.0.0.1:26000, connection attempt failed: SocketException: Error connecting to 127.0.0.1:26000 :: caused by :: Connection refused :
connect@src/mongo/shell/mongo.js:328:13
@(connect):1:6
exception: connect failed

trying to start mongos

You are trying to connect to mongos but it is not up
The command you used to start mongos is not correct
Please read your lab instructions again.l think you are given an incomplete mongos.conf and you are asked to add some more entries and start mongos
The very first snapshot in this thread shows you started mongos the correct way but it failed due to missing configDB
Suggest you to reset your workspace and start fresh
Also search our forum threads.You will get lot of clues

user@M103# mongos -f mongos.conf
Error reading config file: No such file or directory
try ‘mongos --help’ for more information

cant understand

The config file should be there
Show output of
pwd
ls -lrt
Also show your IDE explorer and editor areas
Did you reset workspace and started from scratch?

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.