Lab: Change the Default DB Path - NonExistentPath error

I have created the directory as shown here

and I also have edited the config file as recommended as shown here

and yet I am still getting this error:
exception in initAndListen: NonExistentPath: Data directory /var/mongodb/db not found., terminating

Thank you for any help :clap:

Check if you have created the dirs in the correct environment

localhost vs IDE terminal

I am using the IDE terminal

Can you cd /var/mongodb/db from your IDE terminal?

Your prompt Wfabio@Wicleices-Air db % does not look like IDE terminal

Yep. You’re right, I guess I’m not in the right environment. That’s what I got when I ran cd /var/mongodb/db from your IDE terminal:

Hi @Ramachandra_Tummala, indeed I was working on the wrong environment. I completed all the lab’s requirements such as:

  1. Create a new folder /var/mongodb/db/;
  2. Edit your config file to use this new directory as the dbpath;
  3. Launch mongod with the new configuration

What happening is I’m able to launch mongod but not to create the user and then I get this when I run the test:

I tried to shutdown the server but it doesn’t working this way. Any thoughts?
Thank you!

Hey @Ramachandra_Tummala, never mind I got it this time. What I was doing wrong is that after launching mongod I was suppose to open a new terminal window in order to connect to MongoDB and create the user.

Thank you!

1 Like