Validate dbpath


I came across a problem with the validation when i change the the dbPath to /var/mongodb/db it works fine when it’s on /data/db but after i change it i gives me a timeout error.

I have created the file and sub file in the var directory and changed owner to vagrant.

changed it in my conf file as well.

Please provide all the steps you did between the time it worked and when it stopped working. Screen shots of the steps are useful.

Well up to the point i had to change the dbPath from /data/db to /var/mongodb/db everything worked fine no time outs and i could connect fine.
All I did after that was create a directory in var called mongodb with a sub directory of db:

sudo mkdir -p mongodb/db

after that i changed the owner :

sudo chown -R vagrant:vagrant mongodb

after that i restarted and tried running the command


and I got the timeout error

You also have to change the owner of /var/mongodb/db and /var/mongodb could have be owned by root as mongod is not writing in it.

i did change the owner
or did i mistake something?

I used sudo chown -R vagrant:vagrant mongodb.
Was that wrong?

The -R option would have changed the ownership for sub directories too. Suggest checking that you can login on the 192 IP.

I does says this.


Sorry, I did not notice the -R.

1 Like

What about the user required by the lab?

Yea I just figured it out I didnt create the new user.

My bad :confused:

Thanks to the help and sorry for wasting your time

It is really not a waste of time.

You could not imagine how much I learn while helping. It is an investment.

1 Like

Hi @John_71101,

I’m glad your issue got resolved. Please feel free to get back to us if you have any other query.

~ Shubham