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

相關文章
相關標籤/搜索