About Lab Configuration File

Hi Kanika,

I’m facing an issue about the path of the configuration file. It seems that the command choose the original file etc/mongod.conf. How can I force the program to choose my new created file in my local machine ?
Many thanks.

The Shared folder is accessible. So I put there my mongod.conf file. It works fine now

You need to stop the existing mongod and restart it by altering the startup string

mongod --config < path to new config file >

Make sure the file has been recently saved and is in your vagrant/shared folder.

1 Like

Hello, I am currently working on the lab - “Change the default db path” and i am unable to run the mongod successfully with the error about not able to listen to the remote ipadress I added as per the lab:

2018-10-22T03:15:47.746+0000 I CONTROL [initandlisten] allocator: tcmalloc
2018-10-22T03:15:47.746+0000 I CONTROL [initandlisten] modules: enterprise
2018-10-22T03:15:47.746+0000 I CONTROL [initandlisten] build environment:
2018-10-22T03:15:47.746+0000 I CONTROL [initandlisten] distmod: ubuntu1404
2018-10-22T03:15:47.746+0000 I CONTROL [initandlisten] distarch: x86_64
2018-10-22T03:15:47.746+0000 I CONTROL [initandlisten] target_arch: x86_64
2018-10-22T03:15:47.746+0000 I CONTROL [initandlisten] options: { config: “/shared/mongod.conf”, net: { bindIp: “127.0.0.1, 192.168.103.100”, port: 27000 }, processManagement: { timeZoneInfo: “/usr/share/zoneinfo” }, security: { authorization: “enabled” }, storage: { dbPath: “/var/mongodb/db”, journal: { enabled: true } }, systemLog: { destination: “file”, logAppend: true, path: “/var/mongodb/mongodb_1021.log” } }
2018-10-22T03:15:47.746+0000 E STORAGE [initandlisten] Failed to set up listener: SocketException: Cannot assign requested address
2018-10-22T03:15:47.746+0000 I CONTROL [initandlisten] now exiting
2018-10-22T03:15:47.746+0000 I CONTROL [initandlisten] shutting down with code:48

Hi Nitin,

Please check here

If you still face any difficulty, let me know!

Kanika

Hi Kanika ,

I have modified my configuration and executing below command to start using that file.
But no output is displayed.

vagrant@m103:~$ mongod --config /home/vagrant/mongod.conf

Modified Configuration is below:-

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

systemLog:
destination: file
logAppend: true
path: /var/log/mongodb/mongod.log

net:
bindIp: 192.168.103.100,localhost
port: 27000

processManagement:
timeZoneInfo: /usr/share/zoneinfo

security:
authorization: enabled

Below is result after running validating lab config:

vagrant@m103:~$ validate_lab_configuration_file
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.

Regards,
Vish