Configuring RabbitMQ Cluster on Cloud

Follow following steps to configure RabbitMQ server Cluster on Rackspace Cetos5.5–

1. Install gcc on the centos by running following commands on the command prompt
[root@RabbitMQ1 /root/] yum -y install make gcc gcc-c++ kernel-devel m4 ncurses-devel openssl-devel
2. Download Erlang source code by using following command
[root@RabbitMQ1 /root/] wget http://www.erlang.org/download/otp_src_R14B.tar.gz
3. Extract downloaded file using following command
[root@RabbitMQ1 /root/] tar -zxvf otp_src_R14B.tar.gz
4. Configure Erlang by running following command
[root@RabbitMQ1 /root/] otp_src_R14B/configure –with-ssl
5. Make and Install Erlang by running following command
[root@RabbitMQ1 /root/] otp_src_R14B/make install

6. Download RabbitMQ server by running following command
[root@RabbitMQ1 /root/] wget http://www.rabbitmq.com/releases/rabbitmq-server/v2.1.1/rabbitmq-server-generic-unix-2.1.1.tar.gz
7. Extract downloaded file using following command in the /usr/local/
8. Fix RabbitMq Erlang process port by adding -kernel inet_dist_listen_min PORT and -kernel inet_dist_listen_max PORT parameters in the file $RABBITMQ_HOME/sbin/rabbitmq-server file

SERVER_ERL_ARGS=”+K true +A30 +P 1048576 \

-kernel inet_default_listen_options  \

-kernel inet_default_connect_options [{nodelay,true}] \

-kernel inet_dist_listen_min 35197 \

-kernel inet_dist_listen_max 35197

9. Open following firewall port by running following commands on the command prompt

iptables -I INPUT 1 -p tcp –dport 5672 -j ACCEPT
iptables -I INPUT 1 -p tcp –dport 4369 -j ACCEPT
iptables -I INPUT 1 -p tcp –dport 35197 -j ACCEPT
/etc/init.d/iptables save
/etc/init.d/iptables restart

10. Follow above steps on each rabbit MQ node.
11. For communication between two nodes they must have the same cookie.
12. Cookie file exist at following location
/root/.erlang.cookie
13. Copy .erlang.cookie from master node RabbitMQNode1 the second node RabbitMQNode2 in the cluster at same location.
14. Remove directory /var/lib/rabbitmq/mnesia on each node
15. Start RabbitMQ server on both nodes by running following command from $RABBITMQ_HOME command prompt
[root@RabbitMQ1 /root/] sbin/ rabbitmq-server –detached
16. Stop RabbitMQ application on node RabbitMQNode2 by running following command from $RABBITMQ_HOME command prompt
[root@RabbitMQ1 /root/] sbin/rabbitmqctl stop_app
17. Reset the RabbitMQNode2 by running following command from $RABBITMQ_HOME command prompt
[root@RabbitMQ1 /root/] sbin/rabbitmqctl reset
18. Run following command from from $RABBITMQ_HOME command prompt at node RabbitMQNode2 to join the rabbit@ RabbitMQNode1 cluster
[root@RabbitMQ1 /root/] sbin/ rabbitmqctl cluster rabbit@RabbitMQNode1
19. Start the RabbitMQ application node RabbitMQ2 by running command from $RABBITMQ_HOME command prompt
[root@RabbitMQ1 /root/] sbin/rabbitmqctl start_app

20. To check RabbitMQ cluster status run follwong command from $RABBITMQ_HOME command prompt
[root@RabbitMQ1 /root/] rabbitmqctl status

sbin/rabbitmqctl status
Status of node rabbit@ RabbitMQNode2 …
[{running_applications,[{rabbit,”RabbitMQ”,”2.1.1″},
{mnesia,”MNESIA CXC 138 12″,”4.4.15″},
{os_mon,”CPO CXC 138 46″,”2.2.5″},
{sasl,”SASL CXC 138 11″,”2.1.9.2″},
{stdlib,”ERTS CXC 138 10″,”1.17.1″},
{kernel,”ERTS CXC 138 10″,”2.14.1″}]},
{nodes,[{disc,[rabbit@ RabbitMQNode1]}, {ram, [rabbit@ RabbitMQNode2]}]},
{running_nodes,[rabbit@ RabbitMQNode1, rabbit@ RabbitMQNode2]}]
…done.

Advertisements

About suniluiit

Technical Architect working in Big data and Cloud technologies for the last 5 years with overall software industry experience of around 9 years. Architected and Working on Impetus Workload Migration Product which allows organizations to saves 50%-80% manual offloading time and cost. It provides faster parallel & scalable data migration to Hadoop along with incremental data options. It also maximize the existing investments in code and reuse of SQL scripts. Architected and Developed cloud agnostic application for deployment and configuration management of the enterprise application including technologies stacks like CQ5, Cassandra, Solr, Application Server, Web server, Haproxy, F5 and messaging server. Experienced in working and leading R&D teams for building new expertise in fields such as Big data, ETL offloading to Big Data and Cloud computing. Worked on some of the impetus open source product around Big Data and Social Media http://code.google.com/p/hadoop-toolkit/ http://code.google.com/p/zing https://github.com/impetus-opensource Specialties: Big data, Hadoop, HIve, Sqoop, Spark, J2EE/ SOA, NoSQL, Cassandra, HBase, Cloud Computing (Private/Hybrid/Public- AWS, Google, Azure, Rackspace, Openstack, VMWare, Terremark, RabbitMQ, Kafka, Memcached, Puppet, HypericHQ, Splunk etc.
This entry was posted in Uncategorized. Bookmark the permalink.

7 Responses to Configuring RabbitMQ Cluster on Cloud

  1. sanjiv singh says:

    thanx budy , it helps me alot….

  2. Marc Fournier says:

    Hi,

    I just discovered you can avoid editing $RABBITMQ_HOME/sbin/rabbitmq-server (which might get overwritten by the next upgrade) and instead put this in /etc/rabbitmq/rabbitmq-env.conf:

    export SERVER_ERL_ARGS=”$SERVER_ERL_ARGS -kernel inet_dist_listen_min 35197 -kernel inet_dist_listen_max 35197″

    Cheers,
    Marc

  3. mudboard.com says:

    Awesome post mate, you have saved me tons of time! Cheers bud.

  4. Joe says:

    Thanks! to you and to Marc Founrier!

  5. suniluiit says:

    thanks everyone…

  6. great Sunil do check my blog also

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s