First, download apache-activemq-5.11.1-bin.zip on Apache's website
Second, extract the three MQ files in E:\tools\apache\activemq\cluster as follows:
Third, in the Apache-activemq-5.11.1-1, In the Apache-activemq-5.11.1-2 and Apache-activemq-5.11.1-3 activemq.xml, locate the Persistenceadapter, modify the persistent adapter, and specify the directory where the files are shared.
<persistenceAdapter> <kahadb directory= "e:/tools/apache/activemq/cluster/kahadb"/> </pers Istenceadapter>
Iv. Modifying port numbers
Locate the following line, Modify the port number of the Apache-activemq-5.11.1-2, the default 61616 modified to 61617 (simulate the second physical machine), modify the Apache-activemq-5.11.1-3 port number, the default 61616 modified to 61618 (simulation of the third physical machine)
V. Access Control page
If you turn off any of these MQ servers, the other two will automatically get the shared files and take over as master
Master Slave of ACTIVEMQ (shared file mode, share files system Ma)