【问题标题】:Mongo db ubuntu 16.04 cant start serviceMongodb ubuntu 16.04 无法启动服务
【发布时间】:2017-08-31 16:32:24
【问题描述】:

我按照本教程https://www.digitalocean.com/community/tutorials/how-to-install-mongodb-on-ubuntu-16-04重新安装了mongo,但它似乎无法启动,这是sudo systemctl status 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:

如果我尝试注释掉 storage lin,它会在 systemLog 行出现相同的错误

【问题讨论】:

  • 你能发布你的/etc/mongod.conf文件吗?
  • 我添加了 mongod.conf 文件
  • 您显示的net 行不正确,它应该没有缩进。
  • @Pjtor 你能解决你的问题吗?
  • 不,我切换到 mysql

标签: node.js mongodb ubuntu


【解决方案1】:

错误消息显示 'storage:' 中的行无法识别,请检查您的 /etc/mongod.conf 文件中存储设置附近的制表符或任何奇怪/特殊字符。

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

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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2016-09-10
    • 2017-07-11
    • 2020-07-15
    • 2018-05-06
    • 1970-01-01
    • 1970-01-01
    • 2020-12-17
    • 2017-08-31
    相关资源
    最近更新 更多