Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/pglass/rabbitmq-vagrant-stuff
A Vagrant setup to play with RabbitMQ clustering
https://github.com/pglass/rabbitmq-vagrant-stuff
Last synced: 3 days ago
JSON representation
A Vagrant setup to play with RabbitMQ clustering
- Host: GitHub
- URL: https://github.com/pglass/rabbitmq-vagrant-stuff
- Owner: pglass
- Created: 2014-07-01T18:27:17.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2014-07-01T19:49:50.000Z (over 10 years ago)
- Last Synced: 2024-11-06T05:12:59.652Z (about 2 months ago)
- Language: Shell
- Homepage:
- Size: 137 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
rabbitmq-vagrant-stuff
======================The Vagrantfile sets up two machines `rabbit1` and `rabbit2` based on Ubuntu 14.04 that can be used in a RabbitMQ cluster on a private network. The addresses are assigned as follows:
- `rabbit1` at address `192.168.33.10`
- `rabbit2` is at address `192.168.33.11`
- The host machine is at `192.168.33.1` (from inside either VM)After the two VMs start up, you should be to create the cluster. On `rabbit2`, run the following:
sudo rabbitmqctl stop_app
sudo rabbitmqctl join_cluster rabbit@rabbit1
sudo rabbitmqctl start_appThen you should be able to check the cluster status and see both nodes `rabbit@rabbit1` and `rabbit@rabbit2` as follows:
sudo rabbitmqctl cluster_status
[{nodes,[{disc,[rabbit@rabbit1,rabbit@rabbit2]}]},
{running_nodes,[rabbit@rabbit2,rabbit@rabbit1]},
{partitions,[]}]
...done.On each VM, the `rabbit` node is available on port 5672.
From the host machine, you should be able to run `python send_repeat.py 192.168.33.10 5672` to send a message every five seconds to the `hello` queue in your cluster. Inside either VM, you should see the queue size increase while this script is running
sudo rabbitmqctl list_queues
Listing queues ...
hello 4
...done.To set an HA policy for the `hello` queue:
sudo rabbitmqctl set_policy ha-policy "^hello" '{"ha-mode": "all"}'### iptables
To create a network partition in your cluster, use `iptables` to disable communication to the other machines ip. From within `rabbit2`, do the following to block `rabbit1`:
sudo iptables -A INPUT -s 192.168.33.10 -j DROP
To see all your iptable rules:
sudo iptables -LTo clear all your iptable rules:
sudo iptables -FTo delete a single iptable rule:
sudo iptables -Dwhere `` represents the index of the rule in the given chain's list.