我正在尝试编辑mongo.conf文件以禁用http,但是重新启动mongo并检查状态时出现错误提示
mongod.service - MongoDB Database Server
Loaded: loaded (/lib/systemd/system/mongod.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Wed 2019-05-08 02:03:39 UTC; 5s ago
Docs: https://docs.mongodb.org/manual
Process: 7449 ExecStart=/usr/bin/mongod --config /etc/mongod.conf (code=exited, status=2)
Main PID: 7449 (code=exited, status=2)
CPU: 23ms
May 08 02:03:39 aimtest systemd[1]: Started MongoDB Database Server.
May 08 02:03:39 aimtest systemd[1]: mongod.service: Main process exited, code=exited, status=2/INVALIDARGUMENT
May 08 02:03:39 aimtest systemd[1]: mongod.service: Unit entered failed state.
May 08 02:03:39 aimtest systemd[1]: mongod.service: Failed with result 'exit-code'.
下面是mongo.conf文件。我要提到的是,仅当我在net下添加一行以禁用http
时,它才产生# 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: 40011
bindIp: 127.0.0.1
http:
enabled: false
# how the process runs
processManagement:
timeZoneInfo: /usr/share/zoneinfo
#security:
# authorization: enabled
# nohttpinterface: true
# rest: false
#operationProfiling:
#replication:
#sharding:
## Enterprise-Only Options:
#auditLog:
#snmp: