M150 : Implementing Internal Authentication Error

Hi, in the M150 Implementing Internal Authentication …When I try to run the command “mongod -f mongod_1.conf”, I am getting error that child process is failed please help me.
and also I tried to run the next steps according to the lecture notes from previous class that is to connect to the port but I am getting the error of …connecting to: mongodb://localhost:27001/admin?compressors=disabled&gssapiServiceName=mongodb
Error: couldn’t connect to server localhost:27001, connection attempt failed: SocketException: Error connecting to localhost:27001 ( :: caused by :: Connection refused :
exception: connect failed
exiting with code 1

Please help me to connect to the port.

Do not try to connect with mongo shell until you fix

Please share the error you get when starting mongodb

1 Like

you have to check for any error from your commands in the console. here is how you can make sure if all is well.

check if any mongo daemon is running: ps aux | grep mongod

root       320  0.0 15.0 1577940 75408 ?       SLl  17:32   0:02 mongod -f mongod_1.conf

then kill them each: kill 320 (the number after root)

start new daemons: mongod -f mongod_1.conf

about to fork child process, waiting until server is ready for connections.
forked process: 372
child process started successfully, parent exiting

if any of your config files includes error then you will get error

about to fork child process, waiting until server is ready for connections.
forked process: 424
ERROR: child process failed, exited with 1

correct any error and then check all 3 daemons are running: ps aux | grep mongod

root       431  0.0 14.7 1577940 73852 ?       SLl  17:36   0:02 mongod -f mongod_1.conf
root       481  0.0 15.1 1577940 75740 ?       SLl  17:36   0:01 mongod -f mongod_2.conf
root       527  0.0 14.6 1577940 73368 ?       SLl  17:36   0:01 mongod -f mongod_3.conf

now connect to any of them to continue: mongo admin --host localhost:27001

1 Like