Concern about the lab 1 answer

when I copied the model answer to mongo shell, following is happened:

mkdir: cannot create directory ‘/data/db’: File exists

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

2020-01-21T20:51:48.611+0000 I CONTROL [initandlisten] MongoDB starting : pid=4218 port=27000 dbpath=/data/db 64-bit host=m103
2020-01-21T20:51:48.611+0000 I CONTROL [initandlisten] db version v3.6.16
2020-01-21T20:51:48.611+0000 I CONTROL [initandlisten] git version: 204ab367a130a4fd2db1c54b02cd6a86e4e07f56
2020-01-21T20:51:48.611+0000 I CONTROL [initandlisten] OpenSSL version: OpenSSL 1.0.1f 6 Jan 2014
2020-01-21T20:51:48.611+0000 I CONTROL [initandlisten] allocator: tcmalloc
2020-01-21T20:51:48.611+0000 I CONTROL [initandlisten] modules: enterprise
2020-01-21T20:51:48.611+0000 I CONTROL [initandlisten] build environment:
2020-01-21T20:51:48.611+0000 I CONTROL [initandlisten] distmod: ubuntu1404
2020-01-21T20:51:48.611+0000 I CONTROL [initandlisten] distarch: x86_64
2020-01-21T20:51:48.612+0000 I CONTROL [initandlisten] target_arch: x86_64
2020-01-21T20:51:48.612+0000 I CONTROL [initandlisten] options: { net: { bindIp: “192.168.103.100,127.0.0.1”, port: 27000 }, security: { authorization: “enabled” }, storage: { dbPath: “/data/db” } }
2020-01-21T20:51:48.612+0000 I - [initandlisten] Detected data files in /data/db created by the ‘wiredTiger’ storage engine, so setting the active storage engine to ‘wiredTiger’.
2020-01-21T20:51:48.612+0000 I STORAGE [initandlisten]
2020-01-21T20:51:48.612+0000 I STORAGE [initandlisten] ** WARNING: Using the XFS filesystem is strongly recommended with the WiredTiger storage engine
2020-01-21T20:51:48.612+0000 I STORAGE [initandlisten] ** See http://dochub.mongodb.org/core/prodnotes-filesystem
2020-01-21T20:51:48.612+0000 I STORAGE [initandlisten] wiredtiger_open config: create,cache_size=488M,cache_overflow=(file_max=0M),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),
2020-01-21T20:51:49.454+0000 I STORAGE [initandlisten] WiredTiger message [1579639909:454954][4218:0x7fe9d8852ac0], txn-recover: Main recovery loop: starting at 2/10112
2020-01-21T20:51:49.575+0000 I STORAGE [initandlisten] WiredTiger message [1579639909:575150][4218:0x7fe9d8852ac0], txn-recover: Recovering log 2 through 3
2020-01-21T20:51:49.644+0000 I STORAGE [initandlisten] WiredTiger message [1579639909:644807][4218:0x7fe9d8852ac0], txn-recover: Recovering log 3 through 3
2020-01-21T20:51:49.701+0000 I STORAGE [initandlisten] WiredTiger message [1579639909:701205][4218:0x7fe9d8852ac0], txn-recover: Set global recovery timestamp: 0
2020-01-21T20:51:49.748+0000 I CONTROL [initandlisten]
2020-01-21T20:51:49.749+0000 I CONTROL [initandlisten] ** WARNING: /sys/kernel/mm/transparent_hugepage/enabled is ‘always’.
2020-01-21T20:51:49.750+0000 I CONTROL [initandlisten] ** We suggest setting it to ‘never’
2020-01-21T20:51:49.751+0000 I CONTROL [initandlisten]
2020-01-21T20:51:49.751+0000 I CONTROL [initandlisten] ** WARNING: /sys/kernel/mm/transparent_hugepage/defrag is ‘always’.
2020-01-21T20:51:49.752+0000 I CONTROL [initandlisten] ** We suggest setting it to ‘never’
2020-01-21T20:51:49.753+0000 I CONTROL [initandlisten]
2020-01-21T20:51:49.756+0000 I FTDC [initandlisten] Initializing full-time diagnostic data capture with directory ‘/data/db/diagnostic.data’
2020-01-21T20:51:49.758+0000 I NETWORK [initandlisten] listening via socket bound to 192.168.103.100
2020-01-21T20:51:49.758+0000 I NETWORK [initandlisten] listening via socket bound to 127.0.0.1
2020-01-21T20:51:49.759+0000 I NETWORK [initandlisten] listening via socket bound to /tmp/mongodb-27000.sock
2020-01-21T20:51:49.760+0000 I NETWORK [initandlisten] waiting for connections on port 27000

After that I can’t see the $ sign for adding code

Brian

Suggest that you go through the Mongod lecture again and pay attention to the fork part.

Hi @Brian_26625,

For future reference - Please refrain from posting answers or any information that could lead to answer in the discussion forum.

You are getting this error because the directories are already there.

As suggested by @007_jb, please rewatch this video lecture - Chapter 1: The Mongod and it will clear all your doubts.

Please feel free to get back to us if you have any other query.

Thanks,
Shubham Ranjan
Curriculum Services Engineer