MongoDB报错: Failed to start mongod.service: Unit mongodb.service is masked

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/weixin_39198406/article/details/83656943

参考:http://club.verimake.com/topics/36
参考:http://stackoverflow.com/questions/37014186/running-mongodb-on-ubuntu-16-04-lts

关于MongoDB报错: Failed to start mongod.service: Unit mongodb.service is masked,可按照以下步骤解决:
打开以下文件:

sudo vim /etc/systemd/system/mongodb.service

把以下内容粘贴到文件中并且保存

[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

执行以下命令:

sudo systemctl enable mongod.service
sudo systemctl daemon-reload
sudo service mongod start

猜你喜欢

转载自blog.csdn.net/weixin_39198406/article/details/83656943