-
Notifications
You must be signed in to change notification settings - Fork 2k
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
set killmode/killsignal in systemd example #4305
set killmode/killsignal in systemd example #4305
Conversation
The default (control-group) kill mode in systemd will kill the associated executors, leading to a commonly seen behavior of nomad client restarts losing all current allocations. setting the KillSignal to SIGINT seems to be a reasonable default, and allows things like leave_on_interrupt to function
Thanks @insanejudge |
I think Certain apps just must not be started more than once with the same shared data foder (e.g. MySQL, MariaDB that cause data (binary log) corruption) to avoid race conditions. With |
There are excellent facilities in nomad for draining nodes in a controlled way, and you should definitely be doing that instead of unceremoniously killing all of the executors - that is not 'nicely terminated' and you have no guarantees that the job is actually exited before rescheduling. Having a In short - with |
@insanejudge did a good job of describing why KillMode=process is the desired behavior.
If you're also using Consul this is a perfect use case for distributed locks / leader election as there are a variety of circumstances in which Nomad could be running a single job more than once: https://www.consul.io/docs/guides/leader-election.html In the future we're planning on adding the ability to automatically drain-on-shutdown which should also address your use case. Also please open new issues instead of commenting on old closed pull requests. Hope this helps! Thanks! |
@schmichael Anything new with regards to automatically drain-on-shutdown for clients. Here I think about distros like Flatcar / Fedora CoreOS that automatically reboot. Perhaps until Nomad I could do as @insanejudge suggested:
|
I'm going to lock this pull request because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active contributions. |
Fixes #4302
The default (control-group) kill mode in systemd will kill the associated executors, leading to a commonly seen behavior of nomad client restarts losing all current allocations.
setting the KillSignal to SIGINT seems to be a reasonable default, and allows things like leave_on_interrupt to function