SystemCtl auto restart Mongod when service is died – Tự động khởi động mongod bằng systemctl

Khi dịch vụ Mongodb bị sập (có thể do bộ nhớ), các bước khởi động tự động:

Edit your mongod service: sudo nano /lib/systemd/system/mongod.service

Add Restart=always under service

Reload systemctl daemon: sudo systemctl daemon-reload

Nguồn https://stackoverflow.com/questions/49768232/how-to-auto-restart-mongodb-in-ubuntu-16-04