Ubuntu 自动重启 MongoDB

Autorestart MongoDB on Ubuntu

我在 systemctl 中 mongodb 设置为自动加载。但是当我向它发出太多请求时,它会崩溃并显示 failed 标记。我怎样才能使 autorestart mongodb 以便即使在出现错误后它仍然可以启动并再次工作,现在我必须手动开处方 systemctl start mongod

正如@papey 所说,需要检查此文件中的 Restart=always 字段 /lib/systemd/system/mongod.service