Error in Config file: Mongod starting on Port 27017

I have created my config file, but when I try to use it in kicking off mongod, I get a message saying “listening on port 27017”. Below is the message I receive when I kickoff the process

mongod --config /shared/ --port 27000


Config File:


Of course, I can manually kickoff using “–port 27000” but when I do that, I get another error when validating the lab using “validate_lab_configuration_file”

“You need to bind the IP address.”

Any help is appreciated as I am unable to figure this out.

Your command seems to be incomplete
You have to pass configfile /shared/config_file but you gave just the directory
Since it is unable to find configfile mongod started on default port 27017
Please check and try again

Command line option you mentioned will work but you have to give additional parameters bindip

Thank you for clarifying that, that was my bad.

I assumed that looking at some other responses in the discussion threads.

Now, when I try to use the entire filename, I am getting the below error.

vagrant@m103:~ vagrant@m103:~ mongod --config /shared/mongod.cfg
Unrecognized option: storage
try ‘mongod --help’ for more information

Looks like indentation problem
In YAML format configfile indentation is important
Don’t use tabs.Use spaces

1 Like

Yep, been there. I removed tabs and replaced with spaces.
If there are tabs, it specifically mentions “cannot parse tab characters” in the error message. This is something else, I’m not sure what.

Hi @sharag,

Please add a space between : and the parameter value.

For example,
path:"/data/db/mongod.log" should be path: "/data/db/mongod.log"

Also, please try to re-write your config file, if you are copying it from the browser and pasting it in your editor, there is a chance that any special character insertion might result in an issue.

Kindly let me know if the issue persists.

Curriculum Support Engineer

Great, that worked!
Sorry, I knew Yaml had issues with tabs but I didn’t realize spacing in the config file made a difference in parsing too. Thank you for your help!

1 Like