Mongo db ubuntu 16.04 无法启动服务



我按照本教程重新安装了 mongo https://www.digitalocean.com/community/tutorials/how-to-install-mongodb-on-ubuntu-16-04 但似乎无法启动,这是 sudo systemctl 状态 mongodb 的结果

 ● mongodb.service - High-performance, schema-free document-oriented database
   Loaded: loaded (/etc/systemd/system/mongodb.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Wed 2017-04-05 16:31:03 UTC; 6s ago
  Process: 14024 ExecStart=/usr/bin/mongod --quiet --config /etc/mongod.conf (code=exited, status=1/FAILURE)
  Main PID: 14024 (code=exited, status=1/FAILURE)    
Apr 05 16:31:02 nodejs-512mb-fra1-01 systemd[1]: Started  High-performance, schema-free document-oriented database.
Apr 05 16:31:03 nodejs-512mb-fra1-01 mongod[14024]: error command line: unrecognized line in 'storage:'
Apr 05 16:31:03 nodejs-512mb-fra1-01 mongod[14024]: use --help for help
Apr 05 16:31:03 nodejs-512mb-fra1-01 systemd[1]: mongodb.service: Main process exited, code=exited, status=1/FAILURE
Apr 05 16:31:03 nodejs-512mb-fra1-01 systemd[1]: mongodb.service: Unit entered failed state.
Apr 05 16:31:03 nodejs-512mb-fra1-01 systemd[1]: mongodb.service:     Failed with result 'exit-code'

我的 mongod.conf 看起来像这样

# mongod.conf
# for documentation of all options, see:
#   http://docs.mongodb.org/manual/reference/configuration-options/
# Where and how to store data.
storage:
  dbPath: /var/lib/mongodb
  journal:
    enabled: true
#  engine:
#  mmapv1:
#  wiredTiger:
# where to write logging data.
systemLog:
  destination: file
  logAppend: true
  path: /var/log/mongodb/mongod.log
# network interfaces
  net:
  port: 27017
  bindIp: 127.0.0.1

#processManagement:
#security:
#operationProfiling:
#replication:
#sharding:
## Enterprise-Only Options:
#auditLog:
#snmp:

如果我尝试注释掉存储 lin,它会在系统日志行上出现相同的错误

错误消息

显示"storage:"中的无法识别行,请检查/etc/mongod.conf文件中的选项卡或任何奇怪/特殊字符。

还可以在此处验证配置文件是否有效 YAML:

http://yaml-online-parser.appspot.com/

相关内容

最新更新