mongodb 在 ubuntu 16.04 上不起作用

mongodb 在 ubuntu 16.04 上不起作用

sudo service mongodb status在终端:

mongodb.service - High-performance, schema-free document-oriented database
   Loaded: loaded (/etc/systemd/system/mongodb.service; enabled; vendor preset: 
   Active: failed (Result: exit-code) since جمعه 2017-08-25 14:47:16 IRDT; 6s ag
  Process: 17268 ExecStart=/usr/bin/mongod --quiet --config /etc/mongod.conf (co
 Main PID: 17268 (code=exited, status=100)

mongod 无法启动并显示代码:

mongod --help for help and startup options
2017-08-25T14:50:31.406+0430 [initandlisten] MongoDB starting : pid=17322 port=27017 dbpath=/data/db 64-bit host=mahdi-RC512
2017-08-25T14:50:31.406+0430 [initandlisten] db version v2.6.10
2017-08-25T14:50:31.406+0430 [initandlisten] git version: nogitversion
2017-08-25T14:50:31.406+0430 [initandlisten] OpenSSL version: OpenSSL 1.0.2g  1 Mar 2016
2017-08-25T14:50:31.406+0430 [initandlisten] build info: Linux lgw01-12 3.19.0-25-generic #26~14.04.1-Ubuntu SMP Fri Jul 24 21:16:20 UTC 2015 x86_64 BOOST_LIB_VERSION=1_58
2017-08-25T14:50:31.406+0430 [initandlisten] allocator: tcmalloc
2017-08-25T14:50:31.406+0430 [initandlisten] options: {}
2017-08-25T14:50:31.448+0430 [initandlisten] journal dir=/data/db/journal
2017-08-25T14:50:31.448+0430 [initandlisten] recover : no journal files present, no recovery needed
2017-08-25T14:50:31.448+0430 [initandlisten] 
2017-08-25T14:50:31.448+0430 [initandlisten] ERROR: Insufficient free space for journal files
2017-08-25T14:50:31.448+0430 [initandlisten] Please make at least 3379MB available in /data/db/journal or use --smallfiles
2017-08-25T14:50:31.448+0430 [initandlisten] 
2017-08-25T14:50:31.448+0430 [initandlisten] exception in initAndListen: 15926 Insufficient free space for journals, terminating
2017-08-25T14:50:31.448+0430 [initandlisten] dbexit: 
2017-08-25T14:50:31.448+0430 [initandlisten] shutdown: going to close listening sockets...
2017-08-25T14:50:31.448+0430 [initandlisten] shutdown: going to flush diaglog...
2017-08-25T14:50:31.448+0430 [initandlisten] shutdown: going to close sockets...
2017-08-25T14:50:31.448+0430 [initandlisten] shutdown: waiting for fs preallocator...
2017-08-25T14:50:31.448+0430 [initandlisten] shutdown: lock for final commit...
2017-08-25T14:50:31.448+0430 [initandlisten] shutdown: final commit...
2017-08-25T14:50:31.448+0430 [initandlisten] shutdown: closing all files...
2017-08-25T14:50:31.448+0430 [initandlisten] closeAllFiles() finished
2017-08-25T14:50:31.448+0430 [initandlisten] journalCleanup...
2017-08-25T14:50:31.448+0430 [initandlisten] removeJournalFiles
2017-08-25T14:50:31.470+0430 [initandlisten] shutdown: removing fs lock...
2017-08-25T14:50:31.470+0430 [initandlisten] dbexit: really exiting now

答案1

错误状态

journal dir=/data/db/journal
recover : no journal files present, no recovery needed
Insufficient free space for journal files.
Please make at least 3379MB available in /data/db/journal....

我假设您的磁盘空间不足,因此守护进程无法创建必要的日志,因此它停止了。如消息所述,您需要 3379MB 的空间/data/db/journal

相关内容