Created
January 27, 2011 12:07
-
-
Save Almad/798431 to your computer and use it in GitHub Desktop.
How to break RabbitMQ cluster
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Scenarios created by Petr Svoboda, kudos to @centrumholdings Operations Department | |
############# | |
# Scenario no. 1 | |
# | |
# @psvo-lenny32 | |
rabbitmqctl stop_app | |
rabbitmqctl reset | |
rabbitmqctl start_app | |
# @psvo-lenny64 | |
rabbitmqctl stop_app | |
rabbitmqctl reset | |
rabbitmqctl cluster rabbit@psvo-lenny{32,64} | |
rabbitmqctl start_app | |
# @psvo-lenny32 | |
python <<EOF | |
import amqplib.client_0_8 as amqp | |
conn = amqp.Connection('psvo-lenny64') | |
ch = conn.channel() | |
ch.queue_declare('test') | |
ch.close() | |
conn.close() | |
EOF | |
# @psvo-lenny64 | |
rabbitmqctl stop_app | |
rabbitmqctl start_app | |
# test queue now gone, as it's not persistent | |
# @psvo-lenny32 | |
python <<EOF | |
import amqplib.client_0_8 as amqp | |
conn = amqp.Connection('psvo-lenny64') | |
ch = conn.channel() | |
ch.queue_declare('test') | |
ch.close() | |
conn.close() | |
EOF | |
# and we're hanging | |
############# | |
# Scenario no. 2 | |
# | |
# @psvo-lenny32 | |
rabbitmqctl stop_app | |
rabbitmqctl reset | |
rabbitmqctl start_app | |
# @psvo-lenny64 | |
rabbitmqctl stop_app | |
rabbitmqctl reset | |
rabbitmqctl cluster rabbit@psvo-lenny{32,64} | |
rabbitmqctl start_app | |
# @psvo-lenny32 | |
python <<EOF | |
import amqplib.client_0_8 as amqp | |
conn = amqp.Connection('psvo-lenny64') | |
ch = conn.channel() | |
ch.queue_declare('test', durable=True) | |
ch.close() | |
conn.close() | |
EOF | |
# @psvo-lenny64 | |
rabbitmqctl stop_app | |
# @psvo-lenny32 | |
rabbitmqctl list_queues | |
# and we're hanging, stopping with ctrl+c | |
# @psvo-lenny32 | |
python <<EOF | |
import amqplib.client_0_8 as amqp | |
conn = amqp.Connection('psvo-lenny32') | |
ch = conn.channel() | |
ch.queue_declare('test', durable=True) | |
ch.close() | |
conn.close() | |
EOF | |
# @psvo-lenny64 | |
rabbitmqctl start_app | |
# @psvo-lenny32 | |
rabbitmqctl stop_app | |
# hanging, cannot restart, we have to kill... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment