mongodb - 编辑 .conf 文件后 Mongodb 状态失败
问题描述
admin
我想通过在数据库中创建用户来启用安全性。然后我创建了该用户,然后我将编辑 mongodb conf 文件。之后,我在连接时遇到了一些问题,我无法与外壳连接。谷歌后,我找到了一个接受答案的问题。我关注了这个问题并做了答案中给出的所有事情,然后在连接 mongo shell 时仍然面临问题。我正在粘贴 mongo 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
#security:
security.authorization: enabled
#operationProfiling:
#replication:
#sharding:
## Enterprise-Only Options:
#auditLog:
解决方案
security:
authorization: enabled
应该没事。并且不要忘记重新启动服务器。
推荐阅读
- excel - Excel-VBA循环工作表
- python - 将函数绑定为在除 first 以外的位置接收“self”的方法
- ruby-on-rails - Rails AJAX 渲染错误 ActionView::Template::Error (undefined local variable or method 'object')
- wordpress - Woocommerce“属性类型复选框”未显示
- php - 如何在 php 中获取本地时区名称?
- javascript - 通过操作按钮使用jsp
- python - 关于期望再匹配一次的正则表达式的问题
- php - 无法使用 Paypal API 退款订单
- quasar-framework - 组件中的抽屉在 Quasar 框架中给出警告“避免直接改变道具......”
- docker - CentOS 7 - 无法在 unix:///var/run/docker.sock 连接到 Docker 守护程序。docker 守护进程是否正在运行?