Activemq installation and master slave setup using shared broker data

9

Click here to load reader

Transcript of Activemq installation and master slave setup using shared broker data

Page 1: Activemq installation and master slave setup using shared broker data

ActiveMQ installation and Master Slave Setup using Shared broker

DataBy Ramakrishna Narkedamilli

Page 2: Activemq installation and master slave setup using shared broker data

Overview:

Apache ActiveMQ is the most popular and powerful open source messaging and Integration Patterns server.Apache ActiveMQ is fast, supports many Cross Language Clients. Using this we can enable to message throttling, redelivery, delay of messages.

In this Presentation will going to see, how to setup ActiveMQ as Master Slave topology using Shared broker Data.

Page 3: Activemq installation and master slave setup using shared broker data

Download the ActiveMQ installer from here http://activemq.apache.org/activemq-5100-release.html

Extract the downloaded installer (apache-activemq-5.10.0.zip) to C:\apache-activemq-5.10.0_Master.

Extract the downloaded installer (apache-activemq-5.10.0.zip) to C:\apache-activemq-5.10.0_Slave.

Open the activemq.xml available under slave broker (C:\apache-activemq-5.10.0_Slave\conf). Change the port numbers for "openwire" and "amqp" and remove the other transport connectors as those are not required(This is to avoid conflict between master and slave brokers)

Page 4: Activemq installation and master slave setup using shared broker data

Open the jetty.xml available under (C:\apache-activemq-5.10.0_Slave\conf) and change the web console port value to 8162 (As Master broker web console port will have default 8161).

Page 5: Activemq installation and master slave setup using shared broker data

Now both activemq instances are ready to run independently. Its time to set up the master slave topology using shared broker data.

Create a new folder c:\apache_activemq_shared_broker.

Open the activemq.xml available under master broker (C:\apache_activemq-5.10.0_Master\conf) and do the below things

a) Add the below highlighted tag "persistenceAdapter" and point to the above created folder (C:\apache_activemq_shared_broker).

b) Modify the tag "dataDirectory" available at root "broker" tag by pointing to the shared broker directory c:\apache_activemq_shared_broker.

c) Add the new element schedulerSupport="true" in the root "broker" tag.

Page 6: Activemq installation and master slave setup using shared broker data

After all the above changes, activemq.xml file will look like below

Page 7: Activemq installation and master slave setup using shared broker data

Address the same above changes in Salve broker activemq.xml file available at (C:\apache-activemq-5.10.0_Slave\conf).

Now start the Master active broker by running the activemq.bat available at (C:\apache-activemq-5.10.0_Master\bin\Win64\). Here Win64 depends on windows version you’re using. If you’re using 32 bit run active.bat available under Win32 instead of Win64.

Page 8: Activemq installation and master slave setup using shared broker data

Now start the Slave activemq broker by running the activemq.bat available at (C:\apache-activemq-5.10.0_Slave\bin\WIN64). You can observe that slave broker is waiting for the lock and it’s trying to check for every 10 seconds about lock availability.

Now if the master broker becomes unavailable, Slave broker will get the lock and becomes Master. Once unavailable broker has been started then it will join the topology and acts like slave broker.

Page 9: Activemq installation and master slave setup using shared broker data

THANKS YOU By Ramakrishna Narkedamilli