Cant validate_lab_launch_mongod

@Milind_19368, I got the error you mentioned: “You need to specify db path /data/db”. How to solve it?

For more information, I mkdir a new folder, then launch the mongod with cmd mongod --port 27000 --dbpath second_mongod --logpath second_mongod/mongod.log --fork

And the result when running ps -ef | grep mongod:

vagrant 6881 1 0 06:29 ? 00:00:04 mongod --port 27000 --dbpath second_mongod/ --logpath second_mongod/mongod.log --fork

Hi @IM_86261,

I suppose you’ll be getting this error while running the validation script?

If yes, you need to specify the exact same dbpath as mentioned in the lab notes as our validation scripts are configured to test your process based on the same otherwise it’ll throw an error.

Also, please keep in mind to create the directories if they don’t exist and provide appropriate permissions.

Thanks,
Muskan

1 Like

@Ryan_Courtney_8612 Issue solved? @Muskan_47318 can you help me out with the following error elaborately. "Client experienced a timeout when connecting to the database - check that mongod is running on the correct port, and that your user was created with the correct settings.”

Hi @Vishnu_36071,

Can you please make sure you have started the mongod instance with the correct options as instructed in the Lab - Launching Mongod and also have you created the user by running the following command ?

mongo admin --host localhost:27000 --eval '
  db.createUser({
    user: "m103-admin",
    pwd: "m103-pass",
    roles: [
      {role: "root", db: "admin"}
    ]
  })
'

Note : This will connect you to the mongo shell and create the above mentioned user.

Thanks,
Shubham Ranjan
Curriculum Support Engineer

I given port number 27017 instead of 27000. Now, it is working. Thanks

Hi @Vishnu_36071,

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

Happy Learning :slight_smile:

Thanks,
Shubham Ranjan
Curriculum Support Engineer

Hi,
I am facing error You need to specify db path /data/db. while trying to validate_lab.
For ps -ef ,
I have received an o/p
vagrant 2666 2642 1 11:18 pts/2 00:00:07 mongod --port 27000
Please help.

You get

From the output of ps you shown, where is the db path specified?

Hi @charan_76062,

As I can see, you have not started your mongod instance with all the options that was mentioned in the lab.

Please read the instructions carefully.

Applying what you’ve learned so far about the mongod process, launch a mongod instance, from the command line, with the following requirements:

  • run on port 27000
  • data files are stored in /data/db/
  • listens to connections from the IP address 192.168.103.100 and localhost
  • authentication is enabled

Hope it helps!

Thanks,
Shubham Ranjan
Curriculum Support Engineer