Can't get Validation Key in Lab - Launching Mongod

I created the user successfully but when I run validate_lab_launch_mongod
I get this message

vagrant@m103:~$ validate_lab_launch_mongod

You need to specify db path /data/db.
vagrant@m103:~$

Did you specified db path to /data/db?

@steevej-1495 im getting below error

You need to bind the IP address to 192.168.103.100.

Yes, I did.

vagrant@m103:~$ mongod --dbpath data/db --port 27000 --bind_ip “192.168.103.100,127.0.0.1” --auth

This was my command

1 Like

I solved it.

DB path should be /data/db instead of data/db

Hi Satyanarayana_Raju_84735,

As suggested, you need to bind the ip to 192.168.103.100.

 mongod --bind_ip 192.168.103.100,127.0.0.1

Kanika

@Kanika I realize this is an older post but for curiosity’s sake, what is the exact format for the bind_ip option arguments?

I have tried how you’ve shown

--bind_ip 127.0.0.1,192.168.103.100

and still ran into issues, when I switched to wrapping the ip addresses in quotes everything started working perfectly.

--bind_ip "127.0.0.1,192.168.103.100"

Can you confirm the format? I was not able to find anything in the official docs (seems like it was focused on the config file not the terminal line commands, but I probably missed it)

I am running Ubuntu 18.04 xterm-256color.

Thanks in advance.

Quotes or no quotes is not specific to mongo but to the shell. Since you specify Ubuntu it is probably the bash shell. In the particular case quotes and no quotes should be equivalent as no special characters are used.

vagrant has some weird interaction when I try to point to the folder data when my current dir is vagrant, which I think is why some are receiving this error.

When I cd to data using

cd /data

from the vagrant dir, it actually brought me to the data folder in root directory.

But using

cd data

brought me to the right directory in vagrant.

Here’s a log when I experiment with it.

vagrant@m103:~$ ls
data  first_mongod  mongodLaunch.conf  var
vagrant@m103:~$ cd /data
vagrant@m103:/data$ ls
db  log.mongod.log
vagrant@m103:/data$ cd ..
vagrant@m103:/$ ls
bin   data     dev  home        initrd.img.old  lib64       media  opt   root  sbin    srv  tmp  vagrant  vmlinuz
boot  dataset  etc  initrd.img  lib             lost+found  mnt    proc  run   shared  sys  usr  var      vmlinuz.old
vagrant@m103:/$ cd ~
vagrant@m103:~$ ls
data  first_mongod  mongodLaunch.conf  var
vagrant@m103:~$ cd '/data'
vagrant@m103:/data$ ls
db  log.mongod.log
vagrant@m103:/data$ cd ..
vagrant@m103:/$ ls
bin   data     dev  home        initrd.img.old  lib64       media  opt   root  sbin    srv  tmp  vagrant  vmlinuz
boot  dataset  etc  initrd.img  lib             lost+found  mnt    proc  run   shared  sys  usr  var      vmlinuz.old
vagrant@m103:/$ cd ~
vagrant@m103:~$ ls
data  first_mongod  mongodLaunch.conf  var
vagrant@m103:~$ cd data
vagrant@m103:~/data$ ls
db  log
vagrant@m103:~/data$ cd ..
vagrant@m103:~$ ls
data  first_mongod  mongodLaunch.conf  var

Also, using a single quote instead of a double quote in configure file solve that same problem for me.

storage:
      dbPath: '/data/db'

systemLog:
      path: '/data/log/mongod.log'
      destination: "file"
      logAppend: true

That is normal behaviour. /data is not the same as /home/vagrant/data/

Hi All,

I did all the changes as mentioned but getting the below error while validating.
“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”

Could anybody help me out what I missed from this? Please see my configuration file below.

mongod.conf

mongod.conf

mongod.conf

for documentation of all options, see:

http://docs.mongodb.org/manual/reference/configuration-options/

Where and how to store data.

storage:
dbPath: “/data/db”
journal:
enabled: true

engine:

mmapv1:

wiredTiger:

where to write logging data.

systemLog:
destination: file
logAppend: true
path: “/data/log/mongod.log”

network interfaces

net:
port: 27000
bindIp: “192.168.103.100”

how the process runs

processManagement:
timeZoneInfo: /usr/share/zoneinfo

#security:

keyFile: “/data/keyfile”

#operationProfiling:

#replication:

replSetName: M103

#sharding:

Enterprise-Only Options:

#auditLog:
#ssl:

mode: “requireSSL”

#PEMKeyFile: “/etc/ssl/ssl.pem”
#CAFile: “/etc/ssl/SSLCA.pem”

#snmp:

security:
authorization: enabled

#security:

authorization: enabled

#security:

authorization: enabled

Thanks a lot.

Please check your config file
Check bind_ip parameter
Don’t include unnecessary parms like replication-do you need it in this lab?
Is mongodb running on port 27000?
Check ps -f|grep mongod
Did you create the user?
What does your mongod.log say

2 Likes