Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make snippet up-start backed #1

Closed
BeOleg opened this issue Nov 25, 2015 · 6 comments
Closed

Make snippet up-start backed #1

BeOleg opened this issue Nov 25, 2015 · 6 comments

Comments

@BeOleg
Copy link

BeOleg commented Nov 25, 2015

What will happen if pm2 will crush?

@dashersw
Copy link
Owner

PM2 is running in no-daemon mode, so the container would stop. You would need to run your containers with --restart=always so that the container restarts on failure.

@BeOleg
Copy link
Author

BeOleg commented Nov 25, 2015

Well, we would not like no induce a full restart, since we pull some configs on that boot of the container...
Is there a problem omitting the no-daemon option?
Thanks!

@BeOleg
Copy link
Author

BeOleg commented Nov 25, 2015

So... upstart won't work because of this:
moby/moby#1024

would it make sense to make pm2 backed by supervisord?

@dashersw
Copy link
Owner

Omitting no-daemon would stop the container as soon as it launches, because PM2 would run in the background. Docker containers need a front-running application.

Actually, PM2 is at least as reliable as supervisord, from my personal experience. So I would trust it. If it would crash due to some unknown reason, it should be OK to restart the container.

Docker containers are supposed to be disposable: it shouldn't make much difference to restart them. If you need to run some tasks only when the container is started for the first time, I would suggest to solve them on your application code.

@BeOleg
Copy link
Author

BeOleg commented Nov 25, 2015

Alright, thanks.
Our problem is that currently our app runs on one node, and because of config pulling, the theoretical situation of restarting the container will cause several seconds of downtime, which is not exactly good for business.

@dashersw
Copy link
Owner

Can you store the configuration locally? In case of a restart, you could reload the configuration locally for zero downtime and then fetch—and update if necessary.

@dashersw dashersw closed this as completed Apr 8, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants