Skip to content

[4.0] rabbitmq: block client port on startup#1563

Merged
vuntz merged 1 commit into
crowbar:stable/4.0from
ilausuch:rabbitmq_block_client_port_on_startup_backport
May 3, 2018
Merged

[4.0] rabbitmq: block client port on startup#1563
vuntz merged 1 commit into
crowbar:stable/4.0from
ilausuch:rabbitmq_block_client_port_on_startup_backport

Conversation

@ilausuch

@ilausuch ilausuch commented Feb 16, 2018

Copy link
Copy Markdown
Contributor

This script blocks the connection to the rabbitmq cluster in case the number of nodes decay bellow the half of the total. In this case the remain rabbit nodes won't accept new connections. The problem to solve is that when a rabbit node has too much clients with low timeout, the final scenario could be a DOS when the clients try to constantly reconnect to rabbitmq and forcing more timeouts.

It takes advantage of the pacemaker notifications that notify when a rabbitmq has failed or has restored. All nodes rabbitmq ports will be blocked if the total number of alive nodes are below to the half of nodes of the cluster, or unblock if its over this value. This prevents the overload of alive nodes and the total block of service.

Only the node that have problems will receive the alert, so it is necessary to notify other nodes to block their ports if necessary. The only case when this script won't work is when the node fails completely and is not able to notify the others.

The script is divided in two parts: On one hand, the alert handler that manages the alerts discarding non interesting alerts, launches to the blocker script in this node and other cluster nodes (via SSH). And in the other hand, the blocker script than checks the condition of running nodes and blocks or unblocks the rabbitmq client port.

(cherry picked from commit 60fb8ce)

Backport from #1554

@ilausuch ilausuch force-pushed the rabbitmq_block_client_port_on_startup_backport branch from deea4a0 to f60a1cf Compare February 16, 2018 11:20
@ilausuch ilausuch changed the title Rabbitmq block client port on startup backport [4.0] Rabbitmq block client port on startup backport Feb 16, 2018
@ilausuch ilausuch force-pushed the rabbitmq_block_client_port_on_startup_backport branch 3 times, most recently from edcc318 to 9330768 Compare February 20, 2018 14:59
@ilausuch

Copy link
Copy Markdown
Contributor Author

1 similar comment
@ilausuch

Copy link
Copy Markdown
Contributor Author

@ilausuch ilausuch changed the title [4.0] Rabbitmq block client port on startup backport [4.0] rabbitmq: block client port on startup Mar 2, 2018
@ilausuch ilausuch force-pushed the rabbitmq_block_client_port_on_startup_backport branch 2 times, most recently from a4b3f22 to 9f9b50d Compare March 8, 2018 08:56

@vuntz vuntz left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See comments in PR against master

@ilausuch ilausuch force-pushed the rabbitmq_block_client_port_on_startup_backport branch from 9f9b50d to 8e13cf0 Compare March 28, 2018 09:22
@ilausuch ilausuch force-pushed the rabbitmq_block_client_port_on_startup_backport branch from 8e13cf0 to 296999d Compare April 9, 2018 09:26
This script blocks the connection to the rabbitmq cluster in case the number of nodes decay bellow the half
of the total. In this case the remain rabbit nodes won't accept new connections if the quorum is reached.

It take advantage of the pacemaker notifications that notify when a rabbitmq has failed or has restored.
All nodes rabbitmq ports will be blocked if the total number of alive nodes are below to the half of
nodes of the cluster, or unblock if its over this value.

The script is divided in two parts: On one hand, the alert handler that manages the alerts discarding non
interesting alerts, launches to the blocker script in this node and other cluster nodes (via SSH).
And in the other hand, the blocker script than checks the condition of running nodes and blocks or unblocks
the rabbitmq client port.

(cherry picked from commit 60fb8ce)
@ilausuch ilausuch force-pushed the rabbitmq_block_client_port_on_startup_backport branch from 296999d to 8342a7d Compare April 11, 2018 20:56
@vuntz vuntz merged commit ee91538 into crowbar:stable/4.0 May 3, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

3 participants