Introduction

This documentation outlines the procedure for clustering your RabbitMQ servers to implement High Availability (HA). The following steps are based on a sample environment to guide you through the process of clustering your RabbitMQ servers.


For a clear understanding of RabbitMQ's role as a broker service in the VIDIZMO architecture, please consult our documentation.


Prerequisites

Before implementing RabbitMQ High Availability, ensure the following prerequisites are met:

  • Have RabbitMQ installed and configured on your system. 
  • RabbitMQ requires Erlang to be installed.
  • Configure RabbitMQ to operate in a cluster mode for HA.
  • Two VMs running Windows Server: rabbitmq1 and rabbitmq2.

To configure in VIDIZMO, ensure the following prerequisites are met: 

  • This applies exclusively to on-premises VIDIZMO deployments.  
  • Administrator privileges are required to proceed with the configuration. 


Setting Up RabbitMQ

Install RabbitMQ

  1. Install Erlang 26.2.5 and RabbitMQ 3.13.3 on both VMs. 

Configure RabbitMQ

  1. Open the RabbitMQ command prompt via the Start menu.
  2. Change the directory to 
C:\Program Files\RabbitMQ Server\rabbitmq_server-<version>\sbin 


3. Add a new user to RabbitMQ, grant appropriate permissions, assign the Administrator tag for management tasks, and enable the RabbitMQ Management Plugin. Execute the following commands:


rabbitmqctl add_user [username] [password]
rabbitmqctl set_user_tags [username] administrator
rabbitmqctl set_permissions -p / admin ".*" ".*" ".*"
rabbitmq-plugins enable rabbitmq_management

4. Allow inbound traffic on the following TCP ports in Windows Firewall:

  • 4369 (EPMD)
  • 5672 (AMQP)
  • 15672 (Management)
  • 25672 (Clustering)

Cluster Setup

  1.  Copy “.erlang.cookie” file from rabbitmq1,and paste it below locations in rabbitmq2:
    • "C:\Users\username\"
    • "C:\Windows\System32\config\systemprofile\"
  2. Reboot both rabbitmq1 and rabbitmq2 servers.

Cluster Formation

  1. After reboot, open the RabbitMQ command line on both VMs.
  2. Execute rabbitmqctl.bat status to ensure RabbitMQ services are running on both servers. 
  3. On rabbitmq2, execute the following commands to form a cluster.
rabbitmqctl stop_app
rabbitmqctl reset
rabbitmqctl join_cluster rabbit@rabbit1
rabbitmqctl start_app


4. After completing the steps above, you should have successfully formed a RabbitMQ HA cluster. 


Verifying Cluster 
  1. Access the RabbitMQ Management UI (typically available at http://localhost:15672).
  2. Ensure both RabbitMQ nodes (rabbitmq1 and rabbitmq2) are visible in the UI. 
A screenshot of a computer

Description automatically generated


Creating HA Policy

  • To create a High Availability (HA) policy in RabbitMQ, navigate to the Policies page within the RabbitMQ Management UI, accessible under the Admin tab. This allows you to define policies for ensuring message queues and exchanges are replicated across nodes.


A screenshot of a computer

Description automatically generated


To configure the High Availability (HA) policy: 

  • Set the priority to 1  
  • HA mode to all. 
  • HA Sync Mode: Automatic 
  • HA Scope: Applies to all 
  •  RabbitMQ is hosted on a local load balancer. 

Configure RabbitMQ in the VIDIZMO Portal

To configure broker service in the VIDIZMO application, please follow the instructions given below:   


Step-1. Login to the VIDIZMO application with the Administrator user.


Step-2. Go to Navigation Menu > Control Panel.



 Step-3. Application Configuration > VIDIZMO Runtime Configuration and click ‘Edit’ to change/update the existing config.




Step-4. Select your Event System as RabbitMQ and enter the connection information as needed, the username and password of your RabbitMQ administrator account, and the AMQP port configured in your RabbitMQ server.


Configure both RabbitMQ servers to operate behind a load balancer, utilizing the LB hostname within the VIDIZMO runtime configuration.


Note: Ensure that inbound TCP port 5672 is permitted on the load balancer to facilitate VIDIZMO connections from VIDIZMO app servers. 


A screenshot of a computer

Description automatically generated


Step-5. Click ‘Update’ to update the latest changes in the system.