Skip to content

Broker Clustered

assimbly edited this page Sep 26, 2021 · 9 revisions

How to set up a clustered broker for ActiveMQ Artemis?

This chapter explains the steps to set up a clustered broker with the following goals:

  • Symmetric cluster: Every node in the cluster is connected to every other node in the cluster.
  • High availability: Continuiaton of the environment after failure (without message loss).
  • Encryption: Communication between broker nodes and client is encrypted (with SSL/TLS).
  • Dynamic discovery: Broker nodes and clients can automatically detect each other.
  • Load balancing: Message load get spreaded over the cluster.

Within ActiveMQ Artemis there are often multiple ways to achieve those goals. They are extensively described in the official documentation:

For the various possible configurations, there are a lot of examples. In this guide we focus an typical set up for a cluster with Assimbly.

Basic setup

This setup assumes there are two broker nodes on two servers. Thus

  • An Assimbly instance is installed on server1
  • An Assimbly instance is installed on server2
  1. Now go the broker page (Broker --> Manage)
  2. Create a default ActiveMQ Artemis
  3. Give the broker the name "01" and save the broker (all setting can be default).

Now the broker is a local single node broker. It already can be started and stopped.

Encryption (TLS/SSL)

Certificates

For server1:

  1. Go to settings --> certificates
  2. Create a self-signed certificates and store it in the keystore (give the certificate the DNS name of the server, i.e. server1).
  3. Export the (public) certificate.

For server2:

  1. Go to settings --> certificates
  2. Create a self-signed certificates and store it in the keystore (give the certificate the DNS name of the server, i.e. server2).
  3. Export the (public) certificate.

Now import the exported certificate of server1 in the the certificate store of server 2 (upload --> certificate --> truststore). Also import the exported certifcate of server2 and upload this the certificate store of server1 (upload --> certificate --> truststore).

Cluster password

The broker configuration can normally be changed from within Assimbly or on the server. Both are password protected. It's however also possible to make the password of the broker also encrypted.

  1. Go to setting --> environment variables
  2. Create a encrypted variable

Cluster

Setup

Dynamic discovery

Load balancing

High Availability

Clients

Complete example of the broker.xml

Clone this wiki locally