Getting error running 'Mongod' to start mongodb

Viewed 64

I'm trying to run mongodb, but typing 'mongod' is giving me the error below, do you know how to fix it?

 mongod                        
2021-05-14T15:12:30.819-0400 I  CONTROL  [main] Automatically disabling TLS 1.0, to force-enable TLS 1.0 specify --sslDisabledProtocols 'none'
2021-05-14T15:12:30.846-0400 I  CONTROL  [initandlisten] MongoDB starting : pid=60494 port=27017 dbpath=/data/db 64-bit host=Chris.local
2021-05-14T15:12:30.846-0400 I  CONTROL  [initandlisten] db version v4.2.3
2021-05-14T15:12:30.846-0400 I  CONTROL  [initandlisten] git version: 6874650b362138df74be53d366bbefc321ea32d4
2021-05-14T15:12:30.846-0400 I  CONTROL  [initandlisten] allocator: system
2021-05-14T15:12:30.846-0400 I  CONTROL  [initandlisten] modules: none
2021-05-14T15:12:30.846-0400 I  CONTROL  [initandlisten] build environment:
2021-05-14T15:12:30.846-0400 I  CONTROL  [initandlisten]     distarch: x86_64
2021-05-14T15:12:30.846-0400 I  CONTROL  [initandlisten]     target_arch: x86_64
2021-05-14T15:12:30.846-0400 I  CONTROL  [initandlisten] options: {}
2021-05-14T15:12:30.848-0400 I  STORAGE  [initandlisten] exception in initAndListen: NonExistentPath: Data directory /data/db not found., terminating
2021-05-14T15:12:30.849-0400 I  NETWORK  [initandlisten] shutdown: going to close listening sockets...
2021-05-14T15:12:30.849-0400 I  -        [initandlisten] Stopping further Flow Control ticket acquisitions.
2021-05-14T15:12:30.849-0400 I  CONTROL  [initandlisten] now exiting
2021-05-14T15:12:30.849-0400 I  CONTROL  [initandlisten] shutting down with code:100

1 Answers

Log file usually contains the clue to debug

You can see in the log

2021-05-14T15:12:30.848-0400 I  STORAGE  [initandlisten] exception in initAndListen: NonExistentPath: Data directory /data/db not found., terminating

The directory /data/db is not found, you need to create this directory and make sure mongod has write permission to this folder.

Related