JFrog has added support for RabbitMQ Quorum Queues, available as an optional parameter in `system.yaml`, because RabbitMQ has deprecated Classic Queue mirroring in version 4.x. Consequently, JFrog will also deprecate Classic Queue support and transition to Quorum Queues. It is recommended to enable Quorum Queues in Xray, as JFrog plans to fully transition to RabbitMQ 4.x and discontinue Classic Queue support in upcoming versions.
Important Notes:
1. Irreversible Migration: Once you switch to quorum queues, rolling back to classic queues is not supported. We strongly recommend switching to quorum queues as they will soon become the default in RabbitMQ 4.x.
2. RabbitMQ Nodes: In an HA architecture, Xray utilises queue mirroring and replication between different RabbitMQ nodes. The recommended installation method involves using split mode and setting up a separate 3-node RabbitMQ cluster with Xray HA. For more information, please refer to our RabbitMQ (Split) for Xray wiki here.
3. Fault-tolerant: A two-node cluster with RabbitMQ Quorum Queues will not be fault-tolerant, as Quorum Queues require a minimum of 3 nodes for HA. For more information, please refer to the RabbitMQ Quorum Queues documentation here.
Prerequisites
JFrog Installer Compatibility:
Xray version:
Ensure you use the installer for the latest Xray version, from and above Xray 3.124.x version, which supports deploying Xray and RabbitMQ with Quorum Queues.
RabbitMQ version:
If you are running a separate cluster of RabbitMQ, ensure you have upgraded RabbitMQ using Xray 3.124.x and above version, which will make the separate RabbitMQ cluster compatible with Xray Quorum Queues.
Migrating to Quorum Queue or Enabling Quorum Queues [From and above 3.124.x]:
This step involves migration of the RabbitMQ Classic Queues to Quorum Queues
Note: If you are enabling Quorum Queues using RabbitMQ Split, please ensure that the RabbitMQ cluster is upgraded using Xray 3.124.x installer.
1. Upgrade Xray to 3.124.x version.
2. Edit the system.yaml present in $JFROG_HOME/xray/var/etc/ folder using the following parameters.
shared:
rabbitMq:
ha_quorum: true
vhost: xray_haq
replicaCount: 3
dataMigrations:
migrate_msgs_from_other_rabbitmq:
vhost: "%2F"
Note: The default shared.rabbitMq.replicaCount is 1.
3. Restart Xray
Troubleshooting on the Xray-RabbitMQ Quorum Queue migration:
1. How to confirm whether migration from Classic Queue to Quorum Queue is completed.
You can check the Xray console.log or xray-server-service.log and confirm the successful migration by comparing with the below logs
$ cat /opt/jfrog/xray/var/log/console.log | grep migrate_msgs_from_other_rabbitmq 0000-00-00T19:32:33.366Z [jfxr ] [INFO ] [221411f0ba98ca36] [system_maintenance_service:254] [MainServer ] Checking rabbitmq shovel from configuration element dataMigrations.migrate_msgs_from_other_rabbitmq 0000-00-00T19:32:36.449Z [jfxr ] [INFO ] [221411f0ba98ca36] [system_maintenance_service:403] [MainServer ] Rabbitmq shovel check from configuration element dataMigrations.migrate_msgs_from_other_rabbitmq has completed successfully 0000-00-00T19:32:36.493Z [jfxr ] [INFO ] [221411f0ba98ca36] [te_msgs_from_other_rabbitmq:62] [MainServer ] Running data migration migrate_msgs_from_other_rabbitmq 0000-00-00T19:32:38.183Z [jfxr ] [INFO ] [221411f0ba98ca36] [te_msgs_from_other_rabbitmq:82] [MainServer ] Finished running data migration migrate_msgs_from_other_rabbitmq
2. How to confirm the weather all messages have been migrated from the RabbitMQ to the Quorum Queue
Log in to RabbitMQ UI, change vhost to ‘/’, and navigate to the Queue and stream. All Classic Queue messages should be zero. Or you can use the below curl command and check for the messages, all should be zero
curl -s -u "$RABBITMQ_USER:$RABBITMQ_PASS" \
"http://localhost:15672/api/queues/%2F"