Hi @Muskan_Sharma @007_jb
I tried to remove everything from the directory and rerun my code but getting the following:
vagrant@m103:~$ rm -r /data/db/
rm: remove write-protected regular file ‘/data/db/journal/WiredTigerLog.0000000016’?
rm: remove write-protected regular file ‘/data/db/journal/WiredTigerPreplog.0000000002’?
rm: remove write-protected regular file ‘/data/db/journal/WiredTigerPreplog.0000000001’?
rm: cannot remove ‘/data/db/journal’: Directory not empty
rm: remove write-protected regular file ‘/data/db/WiredTiger.turtle’?
rm: remove write-protected regular file ‘/data/db/log.log.2019-10-16T18-19-28’?
rm: remove write-protected regular file ‘/data/db/WiredTigerLAS.wt’?
rm: remove write-protected regular file ‘/data/db/log.log.2019-10-16T18-21-22’?
rm: remove write-protected regular file ‘/data/db/diagnostic.data/metrics.2019-10-16T19-02-24Z-00000’?
rm: remove write-protected regular file ‘/data/db/diagnostic.data/metrics.2019-10-16T19-03-02Z-00000’?
rm: cannot remove ‘/data/db/diagnostic.data’: Directory not empty
rm: remove write-protected regular file ‘/data/db/log.log.2019-10-16T18-19-21’?
I clicked Enter after each one of those.
Then checked the directory and got this:
vagrant@m103:~$ ls -l /data/db
total 28
-rw------- 1 root root 1107 Oct 16 19:03 WiredTiger.turtle
-rw------- 1 root root 4096 Oct 16 19:03 WiredTigerLAS.wt
drwx------ 2 vagrant vagrant 4096 Oct 17 19:43 diagnostic.data
drwx------ 2 vagrant vagrant 4096 Oct 16 19:03 journal
-rw------- 1 root root 1518 Oct 16 18:14 log.log.2019-10-16T18-19-21
-rw------- 1 root root 1518 Oct 16 18:19 log.log.2019-10-16T18-19-28
-rw------- 1 root root 1518 Oct 16 18:21 log.log.2019-10-16T18-21-22
Ran my code again to try connect to mongod but it is still not working:
vagrant@m103:~$ mongod --port 27000 --dbpath /data/db --auth --bind_ip 192.168.103.100,127.0.0.1
2019-10-17T19:51:56.005+0000 I CONTROL [initandlisten] MongoDB starting : pid=13990 port=27000 dbpath=/data/db 64-bit host=m103
2019-10-17T19:51:56.005+0000 I CONTROL [initandlisten] db version v3.6.14
2019-10-17T19:51:56.005+0000 I CONTROL [initandlisten] git version: cbef87692475857c7ee6e764c8f5104b39c342a1
2019-10-17T19:51:56.005+0000 I CONTROL [initandlisten] OpenSSL version: OpenSSL 1.0.1f 6 Jan 2014
2019-10-17T19:51:56.005+0000 I CONTROL [initandlisten] allocator: tcmalloc
2019-10-17T19:51:56.005+0000 I CONTROL [initandlisten] modules: enterprise
2019-10-17T19:51:56.005+0000 I CONTROL [initandlisten] build environment:
2019-10-17T19:51:56.005+0000 I CONTROL [initandlisten] distmod: ubuntu1404
2019-10-17T19:51:56.005+0000 I CONTROL [initandlisten] distarch: x86_64
2019-10-17T19:51:56.005+0000 I CONTROL [initandlisten] target_arch: x86_64
2019-10-17T19:51:56.005+0000 I CONTROL [initandlisten] options: { net: { bindIp: “192.168.103.100,127.0.0.1”, port: 27000 }, security: { authorization: “enabled” }, storage: { dbPath: “/data/db” } }
2019-10-17T19:51:56.005+0000 I STORAGE [initandlisten]
2019-10-17T19:51:56.005+0000 I STORAGE [initandlisten] ** WARNING: Using the XFS filesystem is strongly recommended with the WiredTiger storage engine
2019-10-17T19:51:56.005+0000 I STORAGE [initandlisten] ** See http://dochub.mongodb.org/core/prodnotes-filesystem
2019-10-17T19:51:56.006+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-10-17T19:51:56.463+0000 E STORAGE [initandlisten] WiredTiger error (13) [1571341916:463316][13990:0x7f53fbd87ac0], wiredtiger_open: __posix_open_file, 715: /data/db/WiredTiger.turtle: handle-open: open: Permission denied
2019-10-17T19:51:56.463+0000 E - [initandlisten] Assertion: 28595:13: Permission denied src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.cpp 486
2019-10-17T19:51:56.463+0000 I STORAGE [initandlisten] exception in initAndListen: Location28595: 13: Permission denied, terminating
2019-10-17T19:51:56.463+0000 I NETWORK [initandlisten] shutdown: going to close listening sockets…
2019-10-17T19:51:56.463+0000 I NETWORK [initandlisten] removing socket file: /tmp/mongodb-27000.sock
2019-10-17T19:51:56.463+0000 I CONTROL [initandlisten] now exiting
2019-10-17T19:51:56.463+0000 I CONTROL [initandlisten] shutting down with code:100