Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Install rabbitmq on ubuntu and configure the cluster
Run the following script on each machine of the cluster:
sudo add-apt-repository 'deb testing main'"
sudo apt-get update
sudo apt-get -q -y --force-yes install rabbitmq-server=3.4.1-1
sudo invoke-rc.d rabbitmq-server stop
echo 'MYCOOKIEVALUE' | sudo tee /var/lib/rabbitmq/.erlang.cookie
sudo chown rabbitmq:rabbitmq /var/lib/rabbitmq/.erlang.cookie
sudo chmod 400 /var/lib/rabbitmq/.erlang.cookie
sudo invoke-rc.d rabbitmq-server start
sudo rabbitmq-plugins enable rabbitmq_management
sudo invoke-rc.d rabbitmq-server stop
sudo invoke-rc.d rabbitmq-server start
sudo rabbitmqctl add_user user1 pwd1
sudo rabbitmqctl set_user_tags user1 administrator
sudo rabbitmqctl set_permissions -p / user1 '.*' '.*' '.*'
Create the cluster, run this script on each server except the first:
sudo rabbitmqctl stop_app
sudo rabbitmqctl join_cluster rabbit@myhostname1
sudo rabbitmqctl start_app
sudo rabbitmqctl set_cluster_name my_cluster_name
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment