bindIp Problem for lab "Launching Mongod"

I launch mongod using a config file:

vagrant@m103:~$ mongod --config chapter1.conf
about to fork child process, waiting until server is ready for connections.
forked process: 2093
child process started successfully, parent exiting

My config file looks like this:

vagrant@m103:~$ cat chapter1.conf
storage:
dbPath: “/data/db”

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

net:
port: 27000
bindIp: “127.0.0.1, 192.168.103.100”

security:
authorization: “enabled”

processManagement:
fork: true
vagrant@m103:~$

I can see the bind settings in the log file:

2019-08-21T14:37:45.250+0000 I CONTROL [initandlisten] options: { config: “chapter1.conf”, net: { bindIp: “127.0.0.1, 192.168.103.100”, port: 27000 }, processManagement: { fork: true }, security: { authorization: “enabled” }, storage: { dbPath: “/data/db” }, systemLog: { destination: “file”, path: “/data/mongod.log” } }
2019-08-21T14:37:45.250+0000 I - [initandlisten] Detected data files in /data/db created by the ‘wiredTiger’ storage engine, so setting the active storage engine to ‘wiredTiger’.

But I get an error when I run the validate script:

vagrant@m103:~ validate_lab_launch_mongod You need to bind the IP address to `192.168.103.100`. vagrant@m103:~

So why? How can I start to resolve this?

Hey @dgiffin

Try without the space. I am pretty sure I have seen that cause this error before.

bindIp: "127.0.0.1,192.168.103.100"
1 Like

That fixed it, thanks so much…

Seriously though, YAML for the configuration file? It’s picky, wondering why you don’t use JSON? :slight_smile:

1 Like

Hey @dgiffin

My guess would be the ability to include comments in a .yml file. And they are claimed to be a bit more human readable.

I guess that’s where the name comes from Yet Another Markup Language. lol