Skip to main content

How to install rabbitmq on centos 6.

*All the comments are well appreciated *
So here we go, one more installation tutorial this time its none other than the great RABBITMQ :)
So to install rabbitmq on centos 6 please follow the below east steps.
  1. Install the EPEL-6 yum repo which contains Erlang R14B with the following command. This step is only for centos 6.
  2. rpm -Uvh http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
  3. Install Erlang with the following command.
  4. yum install erlang
  5. Install RabbitMQ from RPM
  6. 1.rpm --import http://www.rabbitmq.com/rabbitmq-signing-key-public.asc
    2.rpm -Uvh http://www.rabbitmq.com/releases/rabbitmq-server/v3.1.4/rabbitmq-server-3.1.4-1.noarch.rpm
By this time you are done installing rabbitmq. So just some points for the quick start.
  1. To make it run as daemon run this
  2. /sbin/chkconfig rabbitmq-server on
  3. To start the rabbit mq.
  4. /etc/init.d/rabbitmq-server start
  5. To stop the rabbitmq
  6. /etc/init.d/rabbitmq-server stop
If you get into any trouble ! logging for the rescue :
Output from the server is sent to a RABBITMQ_NODENAME.log file in the RABBITMQ_LOG_BASE directory. Additional log data is written to RABBITMQ_NODENAME-sasl.log
So for some quick examples and all.
Check out these python examples from the following links.
Python examples
and
Github

After successfully installing rabbitmq, lets try to understand how it works.
  • In this set up where you start your sever that system acts a broker. So all the message will go through this.
  • So we have these exchange points to which queues are attached.
  • In broker this exchange takes the incoming message and puts in the particular queue.
  • Question is how exchange knows to which queue msg has to be enqueued? The answer is routing key.
  • All the messages carry a routing key, and each queue can be associated with a particular routing key.
  • So based on the routing key that msg will be enqueued to particular queue.(only exception is fanout[you ll come to knwo what is fanout])
Different kinds of exchanges.
  • Direct exchange:
  • Each queue will be binded to a different routing key. So any incoming msg will be enqueued to the queue whos routing key matches with the queues routing key.
  • Fan out exchange:
  • There queus are binded to the exchanges and the routing keys are optional. All the messages received by this exchange will be enqueued to all the queues regardless of routing keys.
  • Topic exchange:
  • This is like multicast.
  • Headers exchange:
  • I dont know much abt this :D .
For further reading please refer this. Gold mine :)

Comments

Popular posts from this blog

Enable stats GUI on haproxy.

Add bottom snippet to the haproxy.conf below the defaults section. listen  stats         bind 19.41.259.10:1234         mode            http         log             global         maxconn 10         clitimeout      100s         srvtimeout      100s         contimeout      100s         timeout queue   100s         stats enable         stats hide-version         stats refresh 30s         stats show-node         stats auth admin:password         stats uri  /haproxy?stats Make sure you are updating the IP address on the bind to your VIP and if you want, you can change the port also. One can even change the uri on the last line of the above snippet, like stats uri /haproxy_stats or whatever one wants. To make sure you have not done any mistake in the config file, one can use the following command to validate. haproxy -c -f haproxy.cfg Once everything looks good, restart the haproxy process and stats GUI should be available at 19.41.259.10:1234/hapro

Sending a SIGHUP signal to some external process from Python script

Code : import psutil import os import signal pids = psutil.get_pid_list() for pid in pids: if psutil.Process(pid).name == "process_name": os.kill(pid,signal.SIGHUP) break Steps to follow. 1.Get the PID of the process, in this case  "process_name"   to which you want to send out a SIGHUP signal. 2.Use os.kill(pid,sig) command to send out the SIGHUP signal to that process. 1.Get the PID of the process to which you want to send out a SIGHUP signal. One has to install a package called psutil by the following command. easy_install psutil Check out the following links for more details https://code.google.com/p/psutil/ https://pypi.python.org/pypi/psutil use psutil.get_pid_list() to get all of the PIDs. psutil.get_pid_list() works in the following manner.  pids = [ int ( x ) for x in os . listdir ( '/proc' ) if x . isdigit ()] return pids once you get all the PIDs get the PID you are i

How to enable Openstack Octavia, LBaaS V2 with devstack.

Little Intro to Octavia. Octavia is a service manager for Openstack Load balancer as a service. Neutron LBaaS V2 plugin talks to Octavia through Octavia driver. Octavia driver talks to Octavia api(o-api) and that in turn talks to Octavia control worker(o-cw). Neutron LBaaS V2 Plugin ----> Octavia plugin driver -----> o-api ----> o-cw Other than o-api and o-cw Octavia has 2 more components, housekeeping(o-hk) and health manager(o-hm). o-api Octavia api server which receives all the request from octavia LBaaS driver and passes it to o-cw. o-cw It's the main workhorse, it creates the load balancer VMs( amphorae ), configures them. o-hk keeps track of spare amphorae. o-hm Manages the health of the amphorae through heartbeats, collects the stats and takes care of fail over by creating a new amphora when it fails to get the heartbeat. How to enable Openstack Octavia, LBaaS V2 with Devstack. Since octavia uses a VM for loadbalancer its needs good a