我安装了mongodb,然后创建了一个mongo服务:
[Unit]
Description=High-performance, schema-free document-oriented database
After=network.target
[Service]
User=mongodb
ExecStart=/usr/bin/mongod --quiet --config /etc/mongod.conf
[Install]
WantedBy=multi-user.target但是,当我启动服务,然后检查状态时,我总是会得到以下错误:
● mongodb.service - High-performance, schema-free document-oriented database
Loaded: loaded (/etc/systemd/system/mongodb.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Mon 2017-04-24 13:08:55 UTC; 6min ago
Process: 1094 ExecStart=/usr/bin/mongod --quiet --config /etc/mongod.conf (code=exited, status=48)
Main PID: 1094 (code=exited, status=48)
Apr 24 13:08:54 ip-172-31-37-163 systemd[1]: Started High-performance, schema-free document-oriented database.
Apr 24 13:08:55 ip-172-31-37-163 systemd[1]: mongodb.service: Main process exited, code=exited, status=48/n/a
Apr 24 13:08:55 ip-172-31-37-163 systemd[1]: mongodb.service: Unit entered failed state.
Apr 24 13:08:55 ip-172-31-37-163 systemd[1]: mongodb.service: Failed with result 'exit-code'.发布于 2017-05-09 08:03:04
问题在于配置文件和更改
bindIp: 127.0.0.1,X.X
至
bindIp: 127.0.0.1,X.X
解决了我的问题
发布于 2020-04-20 13:07:19
尝试更改所有者权限
chown -R mongodb:mongodb /var/lib/mongodb chown mongodb:mongodb /tmp/mongodb-27017
发布于 2018-01-05 22:48:04
在MongoDB 3.6中,@Chlebta提出的括号对我无效,并返回了错误:
mongod.service:主进程退出,code=exited,status=2/INVALIDARGUMENT
我的错误是用逗号和空格分隔IP地址。地址之间必须只有逗号:
bindIp: 127.0.0.1,X.X.X.X,Y.Y.Y.Yhttps://stackoverflow.com/questions/43589290
复制相似问题