Mongodb启动时报错

[root@node1 bin]# mongod
2019-11-05T12:51:43.578+0800 I  CONTROL  [main] Automatically disabling TLS 1.0, to force-enable TLS 1.0 specify --sslDisabledProtocols 'none'
2019-11-05T12:51:43.584+0800 I  CONTROL  [initandlisten] MongoDB starting : pid=26746 port=27017 dbpath=/data/db 64-bit host=node1
2019-11-05T12:51:43.584+0800 I  CONTROL  [initandlisten] db version v4.2.1
2019-11-05T12:51:43.584+0800 I  CONTROL  [initandlisten] git version: edf6d45851c0b9ee15548f0f847df141764a317e
2019-11-05T12:51:43.584+0800 I  CONTROL  [initandlisten] OpenSSL version: OpenSSL 1.0.1e-fips 11 Feb 2013
2019-11-05T12:51:43.584+0800 I  CONTROL  [initandlisten] allocator: tcmalloc
2019-11-05T12:51:43.584+0800 I  CONTROL  [initandlisten] modules: none
2019-11-05T12:51:43.584+0800 I  CONTROL  [initandlisten] build environment:
2019-11-05T12:51:43.584+0800 I  CONTROL  [initandlisten]     distmod: rhel70
2019-11-05T12:51:43.584+0800 I  CONTROL  [initandlisten]     distarch: x86_64
2019-11-05T12:51:43.584+0800 I  CONTROL  [initandlisten]     target_arch: x86_64
2019-11-05T12:51:43.584+0800 I  CONTROL  [initandlisten] options: {}
2019-11-05T12:51:43.585+0800 I  STORAGE  [initandlisten] exception in initAndListen: NonExistentPath: Data directory /data/db not found., terminating
2019-11-05T12:51:43.585+0800 I  NETWORK  [initandlisten] shutdown: going to close listening sockets...
2019-11-05T12:51:43.585+0800 I  NETWORK  [initandlisten] removing socket file: /tmp/mongodb-27017.sock
2019-11-05T12:51:43.585+0800 I  -        [initandlisten] Stopping further Flow Control ticket acquisitions.
2019-11-05T12:51:43.585+0800 I  CONTROL  [initandlisten] now exiting
2019-11-05T12:51:43.585+0800 I  CONTROL  [initandlisten] shutting down with code:100

 

 

 

解决方案:

我的是bin/mongodb.conf文件 用 yaml 格式编辑的,但是空格是直接用的tab空格的,把tab空格修改为4个空格保存退出,再次运行mongod -f bin/mongodb.conf  就可以

 

你可能感兴趣的:(Mongodb学习,Mongodb启动报错)