0

I have been trying to install the mongo shell since two days but I am stuck on the same error which is been not solved on any of the posts. Have seen many tutorials regarding this but it wasn't fruitful. I hope someone could me to bring me back on the track. Thanks in advance.

2017-08-01T00:46:18.842+0530 I CONTROL  [init and listen] MongoDB starting : pid=28050 port=27017 dbpath=/data/db 64-bit host=Salonis-MacBook-Pro-2.local
2017-08-01T00:46:18.842+0530 I CONTROL  [init and listen] db version v3.4.6
2017-08-01T00:46:18.843+0530 I CONTROL  [init and listen] git version: c55eb86ef46ee7aede3b1e2a5d184a7df4bfb5b5
2017-08-01T00:46:18.843+0530 I CONTROL  [init and listen] OpenSSL version: OpenSSL 0.9.8zh 14 Jan 2016
2017-08-01T00:46:18.843+0530 I CONTROL  [init and listen] allocator: system
2017-08-01T00:46:18.843+0530 I CONTROL  [init and listen] modules: enterprise 
2017-08-01T00:46:18.843+0530 I CONTROL  [init and listen] build environment:
2017-08-01T00:46:18.843+0530 I CONTROL  [init and listen]     distarch: x86_64
2017-08-01T00:46:18.843+0530 I CONTROL  [init and listen]     target_arch: x86_64
2017-08-01T00:46:18.843+0530 I CONTROL  [init and listen] options: {}
2017-08-01T00:46:18.867+0530 I STORAGE  [init and listen] exception in initAndListen: 20 Attempted to create a lock file on a read-only directory: /data/db, terminating
2017-08-01T00:46:18.867+0530 I NETWORK  [init and listen] shutdown: going to close listening sockets...
2017-08-01T00:46:18.867+0530 I NETWORK  [init and listen] shutdown: going to flush dialog...
2017-08-01T00:46:18.867+0530 I CONTROL  [init and listen] now exiting
2017-08-01T00:46:18.867+0530 I CONTROL  [init and listen] shutting down with code:100
Jon
  • 2,932
  • 2
  • 23
  • 30
  • Seems you can't write to the data directory: Attempted to create a lock file on a read-only directory: /data/db – Rool Paap Jul 31 '17 at 21:12
  • I edited the title of your question to include the error at hand. I also edited the body of your question so that your log renders properly - please see [the editing help](https://stackoverflow.com/editing-help) for more information on formatting. Good luck! – Jon Jul 31 '17 at 21:51

1 Answers1

0

just type $ sudo mongod

then console show waiting for connections of 27017

Reference is https://scotch.io/tutorials/an-introduction-to-mongodb

KOO
  • 61
  • 6