Launching Mongod (Past Due)

I missed the cutoff to figure out the labs. However, for anyone out there struggling, if you follow the example in the first video of Chapter 1, it will show you exactly what you need to do. Just remember that if you use –fork, it’ll allow you to use the same Terminal window, but if you don’t, you’ll need two different Terminal shells to complete the lab. The only other thing that tripped me up was that my

--bind_ip "127.0.0.1,192.168.103.100"

had a space between the comma and the next IP address, so I would get the error “You need to bind the IP address to 192.168.103.100.

I had to shutdown/exit Vagrant and rerun the command without a space and it worked.

That was tough. Hopefully I’ll be able to get my grade backup. Good luck to you all.

Hi @Terence_36931,

The space between the comma and the next IP address does not pose any issues. As you can see in the snip below, it works fine for me.

vagrant@m103:~$ mongod --port 27000 --dbpath /data/db --auth --bind_ip “127.0.0.1, 192.168.103.100”
2019-07-26T11:41:04.389+0000 I CONTROL [initandlisten] MongoDB starting : pid=2169 port=27000 dbpath=/data/db 64-bit host=m103
2019-07-26T11:41:04.390+0000 I CONTROL [initandlisten] db version v3.6.12
2019-07-26T11:41:04.390+0000 I CONTROL [initandlisten] git version: c2b9acad0248ca06b14ef1640734b5d0595b55f1
2019-07-26T11:41:04.391+0000 I CONTROL [initandlisten] OpenSSL version: OpenSSL 1.0.1f 6 Jan 2014
2019-07-26T11:41:04.391+0000 I CONTROL [initandlisten] allocator: tcmalloc
2019-07-26T11:41:04.391+0000 I CONTROL [initandlisten] modules: enterprise
2019-07-26T11:41:04.392+0000 I CONTROL [initandlisten] build environment:
2019-07-26T11:41:04.393+0000 I CONTROL [initandlisten] distmod: ubuntu1404
2019-07-26T11:41:04.393+0000 I CONTROL [initandlisten] distarch: x86_64
2019-07-26T11:41:04.393+0000 I CONTROL [initandlisten] target_arch: x86_64
2019-07-26T11:41:04.394+0000 I CONTROL [initandlisten] options: { net: { bindIp: “127.0.0.1, 192.168.103.100”, port: 27000 }, security: { authorization: “enabled” }, storage: { dbPath: “/data/db” } }
2019-07-26T11:41:04.395+0000 I - [initandlisten] Detected data files in /data/db created by the ‘wiredTiger’ storage engine, so setting the active storage engine to ‘wiredTiger’.
2019-07-26T11:41:04.395+0000 I STORAGE [initandlisten]
2019-07-26T11:41:04.395+0000 I STORAGE [initandlisten] ** WARNING: Using the XFS filesystem is strongly recommended with the WiredTiger storage engine
2019-07-26T11:41:04.395+0000 I STORAGE [initandlisten] ** See http://dochub.mongodb.org/core/prodnotes-filesystem
2019-07-26T11:41:04.396+0000 I STORAGE [initandlisten] wiredtiger_open config: create,cache_size=488M,session_max=20000,eviction=(threads_min=4,threads_max=4),config_base=false,statistics=(fast),compatibility=(release=“3.0”,require_max=“3.0”),log=(enabled=true,archive=true,path=journal,compressor=snappy),file_manager=(close_idle_time=100000),statistics_log=(wait=0),verbose=(recovery_progress),
2019-07-26T11:41:04.909+0000 I STORAGE [initandlisten] WiredTiger message [1564141264:909175][2169:0x7feee4824a80], txn-recover: Main recovery loop: starting at 10/5120
2019-07-26T11:41:04.973+0000 I STORAGE [initandlisten] WiredTiger message [1564141264:973250][2169:0x7feee4824a80], txn-recover: Recovering log 10 through 11
2019-07-26T11:41:05.013+0000 I STORAGE [initandlisten] WiredTiger message [1564141265:13276][2169:0x7feee4824a80], txn-recover: Recovering log 11 through 11
2019-07-26T11:41:05.046+0000 I STORAGE [initandlisten] WiredTiger message [1564141265:46893][2169:0x7feee4824a80], txn-recover: Set global recovery timestamp: 0
2019-07-26T11:41:05.056+0000 I CONTROL [initandlisten]
2019-07-26T11:41:05.056+0000 I CONTROL [initandlisten] ** WARNING: /sys/kernel/mm/transparent_hugepage/enabled is ‘always’.
2019-07-26T11:41:05.056+0000 I CONTROL [initandlisten] ** We suggest setting it to ‘never’
2019-07-26T11:41:05.056+0000 I CONTROL [initandlisten]
2019-07-26T11:41:05.056+0000 I CONTROL [initandlisten] ** WARNING: /sys/kernel/mm/transparent_hugepage/defrag is ‘always’.
2019-07-26T11:41:05.056+0000 I CONTROL [initandlisten] ** We suggest setting it to ‘never’
2019-07-26T11:41:05.056+0000 I CONTROL [initandlisten]
2019-07-26T11:41:05.058+0000 I FTDC [initandlisten] Initializing full-time diagnostic data capture with directory ‘/data/db/diagnostic.data’
2019-07-26T11:41:05.060+0000 I NETWORK [initandlisten] waiting for connections on port 27000

Thanks for sharing your feedback :slight_smile:

Happy learning!

Regards,
Muskan
Curriculum Support Engineer

Hey, here’s what put initially:

vagrant@m103:~ mongod --port 27000 --dbpath /data/db/ --bind_ip "127.0.0.1, 192.168.103.100" --logpath /data/db/mongod.log --fork about to fork child process, waiting until server is ready for connections. forked process: 2874 child process started successfully, parent exiting vagrant@m103:~ mongo admin --host localhost:27000 --eval ’
db.createUser({
user: “m103-admin”,
pwd: “m103-pass”,
roles: [
{role: “root”, db: “admin”}
]
})

MongoDB shell version v3.6.12
connecting to: mongodb://localhost:27000/admin?gssapiServiceName=mongodb
Implicit session: session { “id” : UUID(“94a78aeb-8c2d-4e06-9a57-a7fa0ee957f2”) }
MongoDB server version: 3.6.12
Successfully added user: {
“user” : “m103-admin”,
“roles” : [
{
“role” : “root”,
“db” : “admin”
}
]
}
vagrant@m103:~ validate_lab_launch_mongod You need to bind the IP address to `192.168.103.100`. vagrant@m103:~ vagrant@m103:~ validate_lab_launch_mongod vagrant@m103:~: command not found
vagrant@m103:~$ validate_lab_launch_mongod
You need to bind the IP address to 192.168.103.100.

The second time around I had this:

vagrant@m103:~ mongod --port 27000 --dbpath /data/db/ --bind_ip "127.0.0.1,192.168.103.100" --logpath /data/db/mongod.log --fork about to fork child process, waiting until server is ready for connections. forked process: 1957 child process started successfully, parent exiting vagrant@m103:~ validate_lab_launch_mongod
XXXXXXXXXXXXXXXXXXX

and it worked fine. Could it depend on the machine if the space matters?

Yes space will create issues
I am not sure how it worked in Muskan’s case.May be OS or machine specific but empty space between IP’s will throw that error(couple of other students also faced same)

1 Like