Change dbpath server shutting down with code 10


I have changed dbpath in the config file. I also ran mkdir -p /var/mongodb/db and crated the directory.

When I run mongod --config mongod.conf I get the following error:


Not sure what else is supposed to be done.

I doubt that your really created /var/mongodb/db because the error is /var/mongodb/db/ not found.

Provide output of

  1. ls -al /var
  2. ls -al /var/mongodb

And do not forget to press [ENTER] after entering a command in the shell.

Remove / at the end of /var/mongodb/db/ in your config file and try

Here you go:

  1. ls -al /var

  2. ls -al /var/mongodb

This is what I created with mkdir command. Did I do something wrong?

@Ramachandra_37567 thank you for suggestion. I tried, same issue.

Please create dir in IDE terminal
You created it on your local host
That is why it is unable to find the dir and failing

That was it! I did not run it in browser IDE but in OS command prompt.

Thanks a lot, it is working! I hope this post will also be useful to others who come across the same problem.