vCloud Availability for vCloud Director: Part 6: Install and Configure RabbitMQ Cluster

By | 09/09/2018

In last post of this series we deployed cassandra node and configured ssl security for cassandra. In this post we will be installing RabbitMQ for vCD.

If you are not following along this series, then I recommend reading earlier posts of this series from below links:

1: vCloud Availability Introduction

2: vCloud Availability Architecture & Components

3: VCAV Deployment

4: Install Cloud Proxy for vCD

5: Deploy Cassandra Cluster

What is RabbitMQ (RMQ)?

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.

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.

In my lab I deployed a new CentOS 6 VM and verified its Networking,DNS and NTP is working fine. 

Next is to install RabitMQ following below steps:

1: Download and Install Erlang rpm.

2: Download and Import RabbitMQ public key

3: Download and Install RabbitMQ rpm.

4: Configure RabbitMQ by following below steps:

a: create testca, server and client directories in /etc/rabbitmq

[root@mgmt-rmq02 ~]# cd /etc/rabbitmq;mkdir -p testca server client

b: Create rabbitmq.config file in /etc/rabbitmq directory with below contents

d: Enable and Start RabbitMQ server service.

e: Enable RabbitMQ UI on http://server-name:15672/

f: Create new admin user for RMQ administration

                                                         RabbitMQ SSL Configuration

1: Install Java on RMQ node

[root@mgmt-rmq02 ~]# rpm -ivh jdk-8u152-linux-x64.rpm

2: Create a public and a private key

Note: In below command the SAN attribute contains DNS names and IP addresses of all of the RabbitMQ hosts and the load balancer. For single RMQ node there will be only one entry. 

# keytool -genkeypair -keystore rootca.jks -storepass vmware -keyalg RSA -validity 1826 -keypass vmware -alias rabbitmq -dname “CN=*.alex.local,OU=vStellar.com, O=Alex.Co, L=Bangalore S=Karnataka C=IN” -ext san=dns:mgmt-rmq02.alex.local,ip:192.168.109.35

If you have multiple RMQ nodes that are load balanced via VIP then modify the above command as shown below

# keytool -genkeypair -keystore rootca.jks -storepass vmware -keyalg RSA -validity 365 -keypass vmware -alias rabbitmq -dname “CN=*.corp-ext.local,OU=Test, O=Corp, L=Palo Alto S=CA C=US” -ext san=dns:test2.corp-ext.local,dns:test3.corp-ext.local,dns:testrabbitmqlb.corp-ext.local,ip:172.31.3.39,ip:172.31.3.40,ip:172.31.3.41

3: Import the RabbitMQ key pair to the PKCS12 trust store

4: Convert the key pair file to PEM format

5: Extract the encrypted private key

6: Decrypt the private key

7: Extract the certificate

8: Install the self-signed certificates by copying them to the newly created directories.

9: Change the ownership of the newly created directories

10: Restart RMQ service

Configure a RabbitMQ Cluster

In my lab I am not setting up RabbitMQ cluster yet. But if you want to do so then instructions are documented here

RMQ-vCD Integration

Connect to VCAV appliance via SSH and run following commands to integrate vCD with RMQ.

root@mgmt-vcav [ ~ ]# export AMQP_ADDRESS=mgmt-rmq02.alex.local

root@mgmt-vcav [ ~ ]# export VCD_USER=admin

root@mgmt-vcav [ ~ ]# export VCD_ADDRESS=192.168.109.30

root@mgmt-vcav [ ~ ]# vcav trust add –address=$AMQP_ADDRESS –port=5671 –accept-all

WARNING – Trusting 3D:DF:04:D7:5E:0C:0C:DA:2A:39:68:51:B7:4C:BB:BA:54:FF:A8:32 for mgmt-rmq02.alex.local:5671

OK

root@mgmt-vcav [ ~ ]# vcav vcd configure-amqp –vcd-address=$VCD_ADDRESS –vcd-user=$VCD_USER –vcd-password-file=~/.ssh/.vcd –amqp-address=$AMQP_ADDRESS –amqp-port=5671 –amqp-user=admin –amqp-password-file=~/.ssh/.amqp –amqp-vhost=/ –amqp-exchange=systemExchange

OK

Now if you login to vCD, you can see the presence of RMQ configuration under System > Administration > Extensibility

Click on Test AMQP Connection to verify vCD can talk to RMQ.

If you login to RMQ, you will see few queues created and vCD cell as consumer.

And that’s it for this post. In next post of this series we will deploy the vSphere Replication appliances.

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