gpt4 book ai didi

mongodb - 在 mongod.conf 上打开身份验证时无法启动 mongodb

转载 作者:可可西里 更新时间:2023-11-01 09:25:57 24 4
gpt4 key购买 nike

当我取消注释/etc/mongod.conf 上的“security:authorization:enabled”选项时,我无法启动 mongod?在 mongodb 3.4.2 上在centos6.5上;

这是常见的打印输出:

sudo service mongod restart
Stopping mongod: [ OK ]
Starting mongod: [FAILED]

这是我的 mongod.conf 文件:这是常见的打印输出:

# mongod.conf

# for documentation of all options, see:
# http://docs.mongodb.org/manual/reference/configuration-options/

# where to write logging data.
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: 58018
bindIp: 127.0.0.1 # Listen to local interface only, comment to listen on all interfaces.

#security: <---uncomment here will start failed
# authorization:enabled <---uncomment here will start failed
#operationProfiling:

#replication:

#sharding:

## Enterprise-Only Options

#auditLog:

#snmp:

最佳答案

一切正常,您只是在 enabled 关键字之前缺少一个空格。启用前空间很重要

```

security:
authorization: enabled

```

为了安全起见,将您的代码段替换为上面的代码段。很难找到,希望能对某人有所帮助。

关于mongodb - 在 mongod.conf 上打开身份验证时无法启动 mongodb,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42428890/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com