Lab <Lab: Configuration File> error on config

On the requirement it says:
Write the configuration file. There should be an empty configuration file in your IDE File Editor, where you can specify options in YAML.

so I wrote a config as:

mongod --dbpath /data/db --logpath /data/log/mongod.log --replSet "M103" --port 27000 --bind_ip "," --keyFile /data/keyfile --fork

Then it returns an error message:

about to fork child process, waiting until server is ready for connections.
forked process: 341
ERROR: child process failed, exited with error number 1
To see additional information in this output, start without the "--fork" option.

It is my first time to learn Linux, I know my knowledge on Windows might not working well.
I typed “–fork” on the IDE panel but it syas “command not found”.

What I need to do now?

Hey @Tianyi_Hu,

Welcome to the MongoDB Community forums :sparkles:

If the owner of the child process cannot access the log path or the log path does not exist, it will fail. so, can you please share the screenshot of the configuration file and the IDE?

It will be much helpful for us to understand the exact reason behind this issue and help you solve it.

Kushagra Kesav

here is my config:
and then I ran code: mongod --config mongod.conf
it says:

Thanks for your help!

Hi @Tianyi_Hu,

Thanks for sharing the screenshot.

So, the configuration is not correct according to the problem statement here:

So, the configuration file will have only net and security enabled as mentioned above.

  port: 27000
  authorization: enabled

Then in terminal 0 you have run this given command

mongod --config mongod.conf

which will launch mongod with the --config command line option.

Open the second terminal and create the user as mentioned down below:

I hope it helps!


That work!
So the requirement ONLY asked me for set up port and enabled authorization, that would allow me to set up user name and password after the configutation done.

I get it!
Man, wish I could be more pro than now.

Thank you!
Have a nice day!

1 Like

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