Mongodb无法启动 - >提出奇怪的错误日志

时间:2017-06-20 03:44:23

标签: mongodb ubuntu

当我将我的环境从本地(mac)移动到我的服务器(ubuntu)时,我解压缩了我的目录和安装了npm install的服务器没有错误或警告,但是我的数据库失败了所以我决定重新安装它基于本教程(好吧,apt-remove mongo*首先)

https://www.digitalocean.com/community/tutorials/how-to-install-mongodb-on-ubuntu-16-04

然后我得到了

Job for mongodb.service failed because the control process exited with error code. See "systemctl status mongodb.service" and "journalctl -xe" for details.

有谁知道这意味着什么?

-- Unit mongodb.service has begun starting up.
Jun 20 03:54:18 ip-172-31-16-163 mongodb[25271]:  * Starting database mongodb
Jun 20 03:54:19 ip-172-31-16-163 mongodb[25271]:    ...fail!
Jun 20 03:54:19 ip-172-31-16-163 systemd[1]: mongodb.service: Control process exited, code=exited status=1
Jun 20 03:54:19 ip-172-31-16-163 sudo[25268]: pam_unix(sudo:session): session closed for user root
Jun 20 03:54:19 ip-172-31-16-163 systemd[1]: Failed to start LSB: An object/document-oriented database.
-- Subject: Unit mongodb.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit mongodb.service has failed.
-- 
-- The result is failed.
Jun 20 03:54:19 ip-172-31-16-163 systemd[1]: mongodb.service: Unit entered failed state.
Jun 20 03:54:19 ip-172-31-16-163 systemd[1]: mongodb.service: Failed with result 'exit-code'.

2 个答案:

答案 0 :(得分:0)

看起来很熟悉。检查文件的所有权。 dbPath中的文件,mongod.run -lock文件,密钥文件...

基本上所有这些文件都列在/etc/mongod.conf

答案 1 :(得分:0)

运行以下命令,它适用于我

  dob: {
      type: 'date',
      format: 'strict_date_optional_time||epoch_millis',
      fields: {
          text: {
             type: 'text',
             term_vector: 'yes',
             analyzer: 'ngram_analyzer',
             search_analyzer: 'standard',
             copy_to: '_all'
          }
      }
  }