我正试图在我的AWS Linux服务器上运行MongoDB身份验证。我一直在使用MongoDB的运行验证没有问题,运行在Windows,Mongo安全身份验证不起作用
>mongod --auth
在我的AWS服务器我试图使用服务命令来执行MongoDB,
$ sudo service mongod start
然而,mogod不启动。我相信问题出在我的/etc/mongod.conf文件中。这里是启用了身份验证的/etc/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: 27017
# bindIp: 127.0.0.1 # Listen to local interface only, comment to listen on all interfaces.
security:
authorization: enabled
#operationProfiling:
#replication:
#sharding:
## Enterprise-Only Options
#auditLog:
#snmp:
问题出在安全标签上。
security:
authorization: enabled
如果包含它,MongoDB将无法启动。如果我把它拿出来,MongoDB开始很好,但没有安全性。我做错了什么?