mongod.service: control process exited, code=exited status=1

Cent OS 7上须要把mongoDB添加到systemd,不然会出现上面的错误mongodb

将mongoDB添加到systemdvim

# vim /usr/lib/systemd/system/mongod.serviceui

[Unit]
Description=mongodb databasecode

[Service]
User=mongod
Group=mongod
Environment="OPTIONS=--quiet -f /etc/mongod.conf"
ExecStart=/usr/bin/mongod $OPTIONS run
PIDFile=/var/run/mongodb/mongod.pidip

[Install]
WantedBy=multi-user.targetget

创建连接
ln -s /usr/lib/systemd/system/mongod.service /etc/systemd/system/multi-user.target.wants/it

从新加载systemctl
systemctl daemon-reloadio

相关文章
相关标签/搜索