SolutionDesign.md
A Consul node can auto-leave the quorum on shutdown, or can be manually removed from the quorum with the leave or force-leave commands run on the node you wish to remove.
Two parameters that affect the behavior of nodes in a cluster on shutdown and restart - both of which have “leave” in them.
leave_on_terminate - false by default. Setting this to true will remove the node from the cluster when it is terminated.
skip_leave_on_interrupt - false by default. Setting this to true will not remove the node from the cluster when it is interrupted. (see more on signals).
A Consul node can be stopped via Unix signals. The behavior depends on how the nodes are notified i.e., which signal is passed to Consul.
Common kill signals and their impact on a running Consul process:
Signal name | Signal value | Effect |
---|---|---|
SIGHUP | 1 | Reloads Consul’s service configuration (some services like Checks, Services, Watches, HTTP Client Address and Log Levels) |
SIGINT | 2 | Usually generated by a Ctrl-c, for graceful shutdown by default |
SIGKILL | 9 | Non-graceful shutdown by default |
SIGTERM | 15 | Non-graceful shutdown by default |
Here are the combinations of signals and configurations, with how Consul behaves:
leave_on_terminate false and skip_leave_on_interrupt false
- On SIGTERM signal known peers list will not be affected.
- On SIGINT(ctrl+c) signal known peers list will become null and the node will be deregistered from remaining nodes.
leave_on_terminate true and skip_leave_on_interrupt false
- On SIGTERM signal known peers list will become null and the node will be deregistered from remaining nodes.
- On SIGINT(ctrl+c) signal known peers list will become null and the node will be deregistered from remaining nodes.
leave_on_terminate true and skip_leave_on_interrupt true
- On SIGTERM signal known peers list will become null and the node will be deregistered from remaining nodes.
- On SIGINT(ctrl+c) signal known peers list will not be affected.
leave_on_terminate true and skip_leave_on_interrupt true
- On SIGTERM signal known peers list will not be affected.
- On SIGINT(ctrl+c) signal known peers list will not be affected.
Note that in case of a node failure (power failure or Consul kill signal), the known peers list will not be affected.???