Sunday, May 26, 2013

Installing RabbitMQ over Ubuntu/CentOS

This post’s gonna walk you through steps on how to install RabbitMQ on a:
  • Ubuntu machine
  • Centos machine
Installing RabbitMQ on Ubuntu

Step-I: Get the setup from                                                                           
Version: rabbitmq-server_3.0.2-1_all.deb

Step-II: Run the .deb file using
sudo dpkg -i rabbitmq-server_3.0.2-1_all.deb                                                                           

Step-III: Start or Stop the rabbitmq server/broker using
/etc/init.d/rabbitmq_server start
/etc/init.d/rabbitmq_server stop                                                                                                

Step-IV: Check the status of the server using
rabbitmqctl status                                                                                                                  

Installing RabbitMQ on CentOS

Step-I: Get the setup from                                                                             
Version: rabbitmq-server-3.0.2-1.noarch.rpm

If the CentOS version on your machine is EL5:(For CentOS versions of the 5 series, Get to know that using the command "lsb_release -a") run the following commands: 
su -c 'rpm -Uvh'
su -c 'yum install foo'                                                                          

Else if its EL6: (For CentOS versions of the 6 series, Get to know that using the command "lsb_release -a") run the following commands: 
su -c 'rpm -Uvh'
su -c 'yum install foo'

Step-II: Get the Erlang repository using:
sudo wget -O /etc/yum.repos.d/epel-erlang.repo

Step-III: Install Erlang using:
sudo yum install erlang                                                                                                              

Step-IV: You need to import a signing key for RabbitMQ, using the command:
sudo rpm --import                                                                 

Step-V: Install the downloaded setup in Step-I using:
sudo yum install rabbitmq-server-3.0.2-1.noarch.rpm                                                                   

Step-VI: Start/Stop rabbitmq server using
sudo /sbin/service rabbitmq-server start
sudo /sbin/service rabbitmq-server stop                                                                                           

Some Extra Notes
  • If you ever feel the need to clear all messages from a rabbitmq queue, run the following commands:
rabbitmqctl stop_app
rabbitmqctl force_reset
/etc/init.d/rabbitmq-server stop
/etc/init.d/rabbitmq-server start                                                                                                  
  • If you need to configure some rabbitmq server parameters off the league, for example "disk_free_limit", create a file called “rabbitmq.config” and place it in “/etc/rabbitmq” for the server to read it at the time of startup. Here’s a sample config file for your ready reference:
    {rabbit, [{disk_free_limit, 1000}]}

All the very best !!!

1 comment:

  1. hey jayati,
    First of all,you have a good thing going on with this blog, and you have got some awesome posts !

    I can't help but notice that you have got a lot of posts for installation and configuration,and if that's what interest you,you should look at chef or puppet to make it painless.For instance,chef has a cookbook for rabbit mq :