Monday, January 26, 2015

ActiveMQ Configuration Explained: Master-Slave With Network Of Brokers

Introduction

In my previous posts, I have covered tutorial about ActiveMQ with the following aspects:

I have explained how master-slave paradigm with shared file system works. In this post, I will explain more advanced topic, namely, Network Of Brokers. I will demonstrate the procedures to setup a network of ActiveMQ brokers with Master-Slave pairs.

Network Topology

As shown in the above figure, I configured two clusters. The WEST cluster contains two ActiveMQ nodes, namely, north and south. These two node forms a master-slave pair. Depending on applications, the nodes number could be 2 or 3. These nodes sharing the same NFS where the kahaDB is located. The same is for the EAST cluster.

Configurations

Directory Layout

The ActiveMQ is installed at:

/opt/app/activemq/apache-activemq-5.10.0

The tomcat is installed at:

/opt/app/activemq/cluster/master-slave/tomcat/apache-tomcat-8.0.17

north and south nodes

/opt/app/amq/NetworkOfBrokers/cluster/north
/opt/app/amq/NetworkOfBrokers/cluster/south

activemq.xml

To setup network of brokers as shown in the introduction, we just need to update the activemq.xml file from west cluster. The file contents is as the following:
 
  1 
  2
  3 
  6
  7     
  8         
  9             file:${activemq.conf}/credentials.properties
 10         
 11     
 12
 13     
 19     
 20
 21     
 25
 26         
 27             
 28               
 29                 
 30                   
 31                      
 32                   
 33                   
 34                     
 35                   
 36                 
 37                 
 38                   
 39                     
 40                   
 41                 
 42               
 43             
 44         
 45
 46         
 47             
 48         
 49
 50         
 51             
 62
 63                      
 64                      
 65
 66                      
 67                         
 68                      
 69             
 70             
 81
 82                      
 83                      
 84
 85                      
 86                         
 87                      
 88             
 89         
 90
 91         
 92             
 93         
 94
 95         
 96             
 97                 
 98                     
 99                 
100                 
101                     
102                 
103                 
104                     
105                 
106             
107         
108
109         
110             
111             
112             
113             
114             
115         
116
117         
118             
119         
120
121     
122 

From the above configuration, you can see that I have configured two network connections, namely, Queue_Connector and Topic_Connector. Copy this activemq.xml to both north and south nodes, and leave the east cluster as it is as show my my previous blog of pure master-slave clustering.

No comments:

Post a Comment

Anypoint Studio Error: The project is missing Munit lIbrary to run tests

Anypoint Studio 7.9 has a bug. Even if we following the article: https://help.mulesoft.com/s/article/The-project-is-missing-MUnit-libraries-...