Installing RabbitMQ for vCloud Director

In this post we will learn how to install RMQ for vCloud Director. Before jumping into any lab activity, lets learn first what is RabbitMQ nd why we need it.

What is RabbitMQ?

RabbitMQ is an open source message-queuing software which helps in facilitating message exchange between 2 or more applications. The exchange of messages is done via queue which is defined by administrator. An application can publish a message to the queue which can be retrieve or consumed by a different application.

A message can include any kind of information for example, it could have information about a process/task that should start on another application may be on another server or it could be just a simple text message.

The queue-manager software stores the messages until a receiving application connects and takes a message off the queue. The receiving application then processes the message in an appropriate manner.

How does it work?

RabbitMQ works by offering an interface, connecting message senders (Publishers) with receivers (Consumers) through an exchange (Broker) which distributes the data to relevant lists (Message Queues).

APPLICATION       EXCHANGE        TASK LIST        WORKER
   [DATA] -------> [DATA] ---> [D]+[D][D][D] --->  [DATA]
 Publisher        EXCHANGE          Queue         Consumer 

To know more about RMQ please read these Tutorials from RabbitMQ official website.

Why we need RMQ for vCloud Director?

When you have a multi-cell vCD deployment in your environment, the vCD cells talks to each other and exchange information. This exchange of information is facilitated via RabbitMQ.

RabbitMQ and vCloud director utilize the Advanced Message Queuing Protocol (AMQP) to talk to each other.

When a vCloud Director Cell wishes to exchange messages (such as system notifications or any other update) with another vCloud Director cell, it places that message within an AMQP broker (Such as RMQ) in one of the queue defined by Administrator. The recipient vCloud Director Cell then retrieves the message from the queue and processes it and if needed it can publish a message back to queue for the source cell from where message was originated.

Lab Setup

In my Lab I have deployed 2 RMQ nodes (for clustering purpose) with following specifications:

Node-1 Hostname/IP: rmqsrv01.alex.local/192.168.109.113

Node-1 Hostname/IP: rmqsrv02.alex.local/192.168.109.114

Memory: 2 GB

CPU: 1 vCPU  with 1.6 GHz speed

HDD: 25 GB

O.S: RHEL 6.6 x86_64 Arch

Both node can ping each other via FQDN (resolved by my DNS server) and both node is connected to Internet. Also both node is configured with local yum repository which I already have in my lab for deploying packages.

Both RMQ nodes are syching their time from my NTP server.

Install RMQ for vCD

Please follow below steps for installing and configuring RMQ nodes:

Step 1) Configure Epel repository

# rpm -ivh https://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm

This will automatically configure epel yum repository.

Step 2) Install Erlang

RMQ requires the Erlang package to run. Erlang is a programming language used to build massively scalable soft real-time systems with requirements on high availability.
With Erlang you could build a messaging app with many connected users and not worry about how they communicate. Erlang was developed by Swedish telecom giant Ericsson over 25 years ago and now a days it is being used with messaging apps like WhatsApp and TigerText.

Erland can be installed via erlang-solution package which configures the yum repository for supported RPM’s needed for installing RMQ. Erland can be installed by following below commands:

# wget http://packages.erlang-solutions.com/erlang-solutions-1.0-1.noarch.rpm

# rpm –import https://packages.erlang-solutions.com/rpm/erlang_solutions.asc

# rpm -ivh erlang-solutions-1.0-1.noarch.rpm (This will automatically configure your yum server for erlang packages)

# yum install erlang

Alternatively you can create a repo file for erlang with below contents:

[root@rmqsrv01 rmq-setup]# cat /etc/yum.repos.d/erlang.repo
[erlang-solutions]
name=Centos $releasever – $basearch – Erlang Solutions
baseurl=https://packages.erlang-solutions.com/rpm/centos/6/x86_64/
gpgcheck=1
gpgkey=https://packages.erlang-solutions.com/rpm/erlang_solutions.asc
enabled=1

Now if you do a yum repolist, you should be able to see the erlang repository populated with packages

rmq01

Step 3) Download and install RabbitMQ server RPM

Latest version of RMQ server can be downloaded from Here

# wget https://www.rabbitmq.com/releases/rabbitmq-server/current/rabbitmq-server-3.6.9-1.el6.noarch.rpm

# rpm –import http://www.rabbitmq.com/rabbitmq-signing-key-public.asc

# yum install rabbitmq-server-3.6.9-1.el6.noarch.rpm

rmq-02

Step 4) Start RMQ server and configure service to start automatically at boot time

# chkconfig rabbitmq-server on

# service rabbitmq-server start

Step 5) Verify RMQ sevrice status

# rabbitmqctl status

rmq03.PNG

Setp 6)  Enable the Management Console

RabbitMQ Management Console is one of the available plugins that lets you monitor the [RabbitMQ] server process through a web-based graphical user interface (GUI). Management console can be enabled by typing below command:

[root@rmqsrv01 rabbitmq]# rabbitmq-plugins enable rabbitmq_management
The following plugins have been enabled:
mochiweb
webmachine
rabbitmq_web_dispatch
amqp_client
rabbitmq_management_agent
rabbitmq_management

Applying plugin configuration to rabbit@rmqsrv01… started 6 plugins.

Now you can access your RMQ server GUI by typing http://rmq_fqdn/15672

Default username/password is guest guest

rmq04-1

Step 7) Changing default admin user (For security hardening)

By default the admi user for RMQ installation is guest/guest. You can change the default administrator account by using below commands

# rabbitmqctl add_user vcdamqp Password (vcdamqp is new admin user)

# rabbitmqctl set_user_tags vcdamqp administrator

# rabbitmqctl set_permissions -p / vcdamqp “.*” “.*” “.*”

Now you can logout the guest user and try logging in via new admin user

rmq04

You will be then presented with following console where you can define things like queue, routing keys, binding etc.

rmq05

 

In next post we will learn about setting up RMQ cluster for high availability.

I hope you enjoyed reading this post. Feel free to share this on social media if it is worth sharing. Be sociable :)