Search code examples
linuxmongodbubuntusystemdsystemctl

Autorestart MongoDB on Ubuntu


I have mongodb set to autoload in systemctl. But when I make too many requests to it, it crashes with the mark failed. how can I make autorestart mongodb so that even after an error it starts up and works again, now I have to manually prescribe systemctl start mongod


Solution

  • As @papey say, there is need to check Restart=always field in this file /lib/systemd/system/mongod.service