【发布时间】:2018-01-25 20:08:56
【问题描述】:
我已经在 Ubuntu Server 16.04 的服务器上安装了 MongoDB 3.6.2。 安装后一切正常。现在我需要在 MongoDB 上启用身份验证,我已经看过指南,并且我已经设置了我的 mongod.conf whit securety: authentication: enabled,这是我的 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
# how the process runs
processManagement:
timeZoneInfo: /usr/share/zoneinfo
securety:
authorization: enabled
#operationProfiling:
#replication:
#sharding:
## Enterprise-Only Options:
#auditLog:
#snmp:
现在,我正在尝试使用 sudo systemtcl restart 重新启动 MongoDB,但是当我运行 status 命令时,MongoDB 状态失败并收到此错误:
mongod.service - High-performance, schema-free document-oriented database
Loaded: loaded (/lib/systemd/system/mongod.service; enabled; vendor preset: e
Active: failed (Result: exit-code) since gio 2018-01-25 13:02:23 CET; 2s ago
Docs: https://docs.mongodb.org/manual
Process: 1409 ExecStart=/usr/bin/mongod --config /etc/mongod.conf (code=exited
Main PID: 1409 (code=exited, status=2
如果我评论安全模式,状态会恢复为活动。
【问题讨论】:
-
您能否分享您在重启 mongodb 服务时收到的错误消息。
-
我已经用错误代码更新了我的帖子
标签: mongodb