Translate to Different Languages!

Thursday, July 11, 2013

Deploying a network of JBoss A-MQ master/slave networked brokers



This document provides details on how to configure and deploy a network of ActiveMQ master/slave networked brokers. We will use the Fuse Management Console (FMC) to simplify configuring and deploying the configuration to multiple broker JVMs.  We will also show how to do this through the command prompt.

Step  1: Download and unpack a JBoss Fuse distribution from jboss.org as well as the JBoss A-MQ distribution

Step 2: Edit etc/users.properties in the Fuse to contain admin/admin for username/password for  the admin user

Step 3: Launch JBoss Fuse by running bin/fuse or bin\fuse.bat


Step 4:  Install the Fuse Management Console (FMC) with the command - fabric:create -p fmc


Step 5: Connect to the Fuse Management Console by browsing to http://localhost:8181/index.html and use the username and password from above for the admin user.  You should see the containers page, with one active container for the JVM that is running the FMC.



Step 6:  Run the following commands at the command prompt.  The containers and profiles can also be created in the management console.

a. Create containers named A-MQ-East1 and A-MQ-East-2
fabric:container-create-child --jmx-user admin --jmx-password admin root A-MQ-East 2

b. Create containers named A-MQ-West1 and A-MQ-West2
fabric:container-create-child --jmx-user admin --jmx-password admin root A-MQ-West 2

c. Execute this command to provision the East containers with a master/slave broker pair identified with the group name "a-mq-east" and networked to the a-mq-west brokers
fabric:mq-create --group a-mq-east --networks a-mq-west --networks-username admin --networks-password admin --assign-container A-MQ-East1,A-MQ-East2 a-mq-east-profile

d. Execute this command to provision the East containers with a master/slave broker pair identified with the group name "a-mq-east" and networked to the a-mq-west brokers
fabric:mq-create --group a-mq-west --networks a-mq-east --networks-username admin --networks-password admin --assign-container A-MQ-West1,A-MQ-West2 a-mq-west-profile

Now the network of brokers are running which is four instances of ActiveMQ, each running in its own container, networked together and with failover.  The containers can be viewed in the management console.


The profiles can also be viewed in the management console.

Now we will test the brokers.

Step 7:  Start a consumer running against a broker running in the "a-mq-west" group:
java -jar mq-client.jar consumer --user admin --password admin --brokerUrl "discovery:(fabric:a-mq-west)"


Step 8: Start a producer running against a broker running in the "a-mq-east" group
 java -jar mq-client.jar producer --user admin --password admin --brokerUrl "discovery:(fabric:a-mq-east)"


As seen above 100 messages were produced and consumed.  This example is also described at https://github.com/FuseByExample/external-mq-fabric-client/blob/master/docs/fabric-ha-setup-master-slave.md.

No comments:

Post a Comment