Hello. Put the server for the application. DB - MondoDB. Everything worked well, but something went wrong, and the base began to crumble constantly. While there is no time to understand, and the application should work. Is it possible to start mongo server automatically after crashing in Ubuntu?
1 answer
You can add to /etc/init/mongodb.conf :
respawn respawn limit 20 30 This will restart Mongi's service 20 times, at intervals of 30 seconds.
But it is better to deal with the cause of the crash, of course.
- Vladimir, is it necessary to restart something after that? - user2497209
service mongodb stop,service mongodb startshould suffice. - Vladimir Gamalyan- Just in case, in the new versions the service is called mongod (without b) (respectively, the
/etc/init/mongod.confconfig file) - Vladimir Gamalyan - Thank you, I will try - user2497209
|