Mongodb在啟動時報錯:
2018-10-16T11:18:54.533+0800 I CONTROL [main] Automatically disabling TLS 1.0, to force-enable TLS 1.0 specify --sslDisabledProtocols 'none'
about to fork child process, waiting until server is ready for connections.
forked process: 1462
ERROR: child process failed, exited with error number 1
To see additional information in this output, start without the "--fork" option.
網上的大部分說的原因是,mongodb服務沒有正常關閉,例如使用了kill -9 PID殺掉,mongod 被鎖。
如何解決這種問題:
-
刪除 mongod.lock 文件和日志文件 mongodb.log ,如果有必要把 log日志全部刪除
-
mongod --repair --dbpath /data/db / --repairpath /tmp/mongodb
我是首次安裝,肯定不是這種情況,於是檢查了下,MongoDB的數據存儲目錄和日志目錄,發現權限有問題,修改權限后就可以了。
