我正在尝试使用Robo 3T远程连接我的Google Cloud服务器,连接到MongoDB v4.0.11,以便我可以从Windows中查看数据。
我正在运行Ubuntu 18.04LTS Minimal。为了启用对MongoDB的远程连接,我首先在我的管理数据库中创建了一个管理员和根用户。
我的问题是,一旦我在
我正在运行Ubuntu 18.04LTS Minimal。为了启用对MongoDB的远程连接,我首先在我的管理数据库中创建了一个管理员和根用户。
我的问题是,一旦我在
/etc/mongod.conf
中的security:
中添加authorization: "enabled"
并重新启动MongoDB,当我运行$:systemctl status mongod
时,我会得到以下状态。● mongod.service - MongoDB Database Server
Loaded: loaded (/lib/systemd/system/mongod.service; disabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Tue 2019-08-06 16:43:51 BST; 1min 20s ago
Docs: https://docs.mongodb.org/manual
Process: 6517 ExecStart=/usr/bin/mongod --config /etc/mongod.conf (code=exited, status=2)
Main PID: 6517 (code=exited, status=2)
Aug 06 16:43:51 instance-1 systemd[1]: Started MongoDB Database Server.
Aug 06 16:43:51 instance-1 mongod[6517]: Unrecognized option: processManagement.authorization
Aug 06 16:43:51 instance-1 mongod[6517]: try '/usr/bin/mongod --help' for more information
Aug 06 16:43:51 instance-1 systemd[1]: mongod.service: Main process exited, code=exited, status=2/INVALIDARGUMENT
Aug 06 16:43:51 instance-1 systemd[1]: mongod.service: Failed with result 'exit-code'.
/etc/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
# how the process runs
processManagement:
timeZoneInfo: /usr/share/zoneinfo
#security:
authorization: "enabled"
#operationProfiling:
#replication:
#sharding:
## Enterprise-Only Options:
#auditLog:
#snmp:
看起来在/etc/mongod.conf
中存在无效参数,但从我在网上阅读的内容来看,我看不出问题所在。