LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Linux Answers > Applications / GUI / Multimedia
User Name
Password

Notices


By szboardstretcher at 2013-07-23 16:21
Rabbitmq installation

Contents

1 Setting up a two node cluster
1.1 master node
1.2 slave node
2 URL's
3 quick reinstallation


1.1 Setting up a two node cluster - MASTER NODE

***You will have to update ip's in the commands
hostname: rabbit1
info: cluster master
ipaddr: 1.1.1.1
Code:
yum update -y; yum install epel-release -y; yum install erlang -y
#change these ips to fit the ip scheme
Code:
echo 127.0.0.1   localhost localhost.localdomain rabbit1 > /etc/hosts
echo 1.1.1.1 rabbit1 >> /etc/hosts
echo 2.2.2.2 rabbit2 >> /etc/hosts
#/etc/sysconfig/network
Code:
sed -i 's/localhost.localdomain/rabbit1/g' /etc/sysconfig/network
reboot

Code:
wget http://www.rabbitmq.com/releases/rabbitmq-server/v3.1.0/rabbitmq-server-...
yum install rabbitmq-server-3.1.0-1.noarch.rpm -y
/etc/init.d/rabbitmq-server start
rabbitmq-plugins enable rabbitmq_management
/etc/init.d/rabbitmq-server stop
echo Bhfyowmciu19827732891 > /var/lib/rabbitmq/.erlang.cookie
rabbitmq-server -detached
rabbitmqctl stop_app
rabbitmqctl reset
rabbitmqctl start_app
rabbitmqctl cluster_status
1.2 setting up a SLAVE NODE

You will have to update the ip's in the commands
hostname: rabbit2
info: cluster slave
ipaddr: 2.2.2.2
Code:
yum update -y; yum install epel-release -y; yum install erlang -y
#/etc/hosts
Code:
echo 127.0.0.1   localhost localhost.localdomain rabbit2 > /etc/hosts
echo 1.1.1.1 rabbit1 >> /etc/hosts
echo 2.2.2.2 rabbit2 >> /etc/hosts
vim /etc/sysconfig/network
Code:
sed -i 's/localhost.localdomain/rabbit2/g' /etc/sysconfig/network
reboot

Code:
wget http://www.rabbitmq.com/releases/rabbitmq-server/v3.1.0/rabbitmq-server-...
yum install rabbitmq-server-3.1.0-1.noarch.rpm -y
/etc/init.d/rabbitmq-server start
rabbitmq-plugins enable rabbitmq_management
/etc/init.d/rabbitmq-server stop
echo Bhfyowmciu19827732891 > /var/lib/rabbitmq/.erlang.cookie
rabbitmq-server -detached
rabbitmqctl stop_app
rabbitmqctl reset
rabbitmqctl join_cluster rabbit@rabbit1
rabbitmqctl start_app
rabbitmqctl cluster_status
URL
dashboard: http://rabbit1:15672/

quick reinstallation

#sometimes rabbit falls out of a cluster

Code:
rpm -ql rabbitmq-server-3.1.0-1.noarch > remove_these.files
yum remove rabbitmq-server-3.1.0-1.noarch
xargs rm -rf < remove_these.files
yum install rabbitmq-server-3.1.0-1.noarch.rpm
/etc/init.d/rabbitmq-server start
rabbitmq-plugins enable rabbitmq_management
/etc/init.d/rabbitmq-server stop
rabbitmq-server -detached
rabbitmqctl stop_app
rabbitmqctl reset
rabbitmqctl join_cluster rabbit@rabbit1
rabbitmqctl start_app
rabbitmqctl cluster_status


  



All times are GMT -5. The time now is 07:01 AM.

Main Menu
Advertisement
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration