【问题标题】:Why does sudo service mongod start fail with linux ec2? [duplicate]为什么 sudo service mongod start 使用 linux ec2 失败? [复制]
【发布时间】:2017-09-08 03:41:30
【问题描述】:

按照这些指示https://docs.mongodb.com/ecosystem/platforms/amazon-ec2/ 配置 mongodb 到 Linux ec2 时遇到一些问题

[root@ip-xxx-xx-xx-xxx /]# sudo service mongod start
Error starting mongod. /var/run/mongodb/mongod.pid exists.


[root@ip-xxx-xx-xx-xxx /]# sudo service mongod restart
Stopping mongod:                                           [  OK  ]
Starting mongod:                                           [FAILED]

我还尝试了rm -f /var/run/mongodb/mongod.pid,但现在立即失败了。

[root@ip-xxx-xx-xx-xxx /]# sudo service mongod start
Starting mongod:                                           [FAILED]

我感觉可能是我的mongod.conf,并尝试根据文档编辑 dbPath 和 sysLogPath。

# mongod.conf

# where to write logging data.
systemLog:
  destination: file
  logAppend: true
  path: "log/mongod.log"

# Where and how to store data.
storage:
  dbPath: "/data"
  journal:
    enabled: true
#  engine:
#  mmapv1:
#  wiredTiger:

# how the process runs
processManagement:
  fork: true  # fork and run in background
  pidFilePath: /var/run/mongodb/mongod.pid  # location of pidfile

我是 AWS 和部署数据库的新手,不胜感激!

【问题讨论】:

  • 检查文件log/mongod.log
  • 当然!谢谢!!!
  • 查看日志:/var/log/mongodb/mongodb.log
  • 我遇到了同样的错误。你找到合适的解决方案了吗?需要帮助

标签: linux mongodb amazon-web-services amazon-ec2


【解决方案1】:

按照@hjpotter92 的建议检查log/mongod.log 后,我发现它是***aborting after fassert() failure

我从下面的链接运行命令,成功了。

sudo rm /tmp/mongodb-27017.sock rm -f /var/run/mongodb/mongod.pid sudo service mongod start

MongoDB Failing to Start - ***aborting after fassert() failure

【讨论】:

  • ..像魅力一样工作..谢谢
【解决方案2】:

您在以 root 身份登录时使用 sudo。 请重新检查是否是导致问题的原因。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2017-01-13
    • 1970-01-01
    • 2017-02-04
    • 1970-01-01
    • 2013-12-03
    • 2015-03-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多