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 文档

相关文章
相关标签/搜索