无法启动,停止,重启mongoDB作为服务

时间:2016-11-21 15:09:44

标签: mongodb amazon-ec2

这是我的mongodb配置文件(亚马逊 - EC2用户)

systemLog:
  destination: file
  logAppend: true
  path: /var/log/mongodb/mongod.log

# Where and how to store data.
storage:
  dbPath: /var/lib/mongo
  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

# network interfaces
net:
  port: 27017
  bindIp: 0.0.0.0  # Listen to local interface only, comment to listen on all interfaces.


replication:
  replSetName: devRepl

我在运行mongoDB时遇到错误 >sudo service mongod restart

Stopping mongod:                                           [  OK  ]
Starting mongod:                                           [FAILED]

但如果使用配置文件 >sudo mongod --config /etc/mongod.conf 运行,则可以正常运行 我哪里错了?

0 个答案:

没有答案