activemq的Master Slave(共享文件方式Shared File System Ma)

1、在apache的官網下載apache-activemq-5.11.1-bin.zipapache

2、在E:\tools\apache\activemq\cluster中解壓三個mq文件以下:服務器

3、在apache-activemq-5.11.1-一、apache-activemq-5.11.1-2和apache-activemq-5.11.1-3的activemq.xml中,找到persistenceAdapter,修改持久化適配器,指定共享文件的目錄。.net

<persistenceAdapter>
            <kahaDB directory="E:/tools/apache/activemq/cluster/kahadb"/>
        </persistenceAdapter>

4、修改端口號
code

找到下面的行,修改apache-activemq-5.11.1-2的端口號,默認的61616修改爲了61617(模擬第二臺物理機),修改apache-activemq-5.11.1-3的端口號,默認的61616修改爲了61618(模擬第三臺物理機)xml

5、訪問控制頁面blog

若是關掉其中任意一個mq服務器,這時會其餘兩臺會自動獲取共享文件,並接管成爲masterip

參考文檔:http://my.oschina.net/xiaoxishan/blog?catalog=3270616 文檔

相關文章
相關標籤/搜索