搭建ActiveMQ Master/Slave+Network Cluster集群
2016-07-12 00:00
316 查看
环境信息
三台虚拟机节点(192.168.100.171<debian171>, 192.168.100.172<debian172>, 192.168.100.173<debian173>)
Debian jessie 8.5
ActiveMQ 5.13.3
node1:192.168.100.171:61616,
node2:192.168.100.172:61616,
node3:192.168.100.173:61616,
node4:192.168.100.171:61626,
node2:192.168.100.172:61626,
node4:192.168.100.173:61626
其中
node1,node2,node3为group1(broker_name:broker_cluster_group1)
node4,node5,node6为group2(broker_name:broker_cluster_group2)
搭建Master/Slave集群
参见“搭建ActiveMQ 5.13 Master/Slave (Debian 8)”和“搭建ActiveMQ Master/Slave(LevelDB+Zookeeper)”
配置networkConnector
group1的activemq.xml
group2的activemq.xml
修改transportConnectors的端口
修改jetty.xml的console端口
OK,逐个启动node1-6,done!
注意
参考资料
http://blog.csdn.net/lifetragedy/article/details/51869032
三台虚拟机节点(192.168.100.171<debian171>, 192.168.100.172<debian172>, 192.168.100.173<debian173>)
Debian jessie 8.5
ActiveMQ 5.13.3
node1:192.168.100.171:61616,
node2:192.168.100.172:61616,
node3:192.168.100.173:61616,
node4:192.168.100.171:61626,
node2:192.168.100.172:61626,
node4:192.168.100.173:61626
其中
node1,node2,node3为group1(broker_name:broker_cluster_group1)
node4,node5,node6为group2(broker_name:broker_cluster_group2)
搭建Master/Slave集群
参见“搭建ActiveMQ 5.13 Master/Slave (Debian 8)”和“搭建ActiveMQ Master/Slave(LevelDB+Zookeeper)”
配置networkConnector
group1的activemq.xml
<broker xmlns="http://activemq.apache.org/schema/core" brokerName="broker_cluster_group1" dataDirectory="${activemq.data}"> <networkConnectors> <networkConnector uri="static:(tcp://debian171:61626,tcp://debian172:61626,tcp://debian173:61626)" duplex="false" /> </networkConnectors>
<persistenceAdapter> <replicatedLevelDB directory="${activemq.data}/leveldb" replicas="3" bind="tcp://0.0.0.0:62620" zkAddress="debian171:2181,debian172:2181,debian173:2181" zkPassword="" zkPath="/activemq/leveldb-stores-g1" hostname="192.168.100.171"/> </persistenceAdapter>
group2的activemq.xml
<broker xmlns="http://activemq.apache.org/schema/core" brokerName="broker_cluster_group2" dataDirectory="${activemq.data}"> <networkConnectors> <networkConnector uri="static:(tcp://debian171:61616,tcp://debian172:61616,tcp://debian173:61616)" duplex="false" /> </networkConnectors>
<persistenceAdapter> <replicatedLevelDB directory="${activemq.data}/leveldb" replicas="3" bind="tcp://0.0.0.0:0" zkAddress="debian171:2181,debian172:2181,debian173:2181" zkPassword="" zkPath="/activemq/leveldb-stores-g2 3ff0 " hostname="debian171"/> </persistenceAdapter>
修改transportConnectors的端口
<transportConnectors> <!-- DOS protection, limit concurrent connections to 1000 and frame size to 100MB --> <transportConnector name="openwire" uri="tcp://0.0.0.0:61626?maximumConnections=1000&wireFormat.maxFrameSize=104857600"/> <transportConnector name="amqp" uri="amqp://0.0.0.0:5682?maximumConnections=1000&wireFormat.maxFrameSize=104857600"/> <transportConnector name="stomp" uri="stomp://0.0.0.0:61623?maximumConnections=1000&wireFormat.maxFrameSize=104857600"/> <transportConnector name="mqtt" uri="mqtt://0.0.0.0:1893?maximumConnections=1000&wireFormat.maxFrameSize=104857600"/> <transportConnector name="ws" uri="ws://0.0.0.0:61624?maximumConnections=1000&wireFormat.maxFrameSize=104857600"/> </transportConnectors>
修改jetty.xml的console端口
<bean id="jettyPort" class="org.apache.activemq.web.WebConsolePort" init-method="start"> <!-- the default port number for the web console --> <property name="host" value="0.0.0.0"/> <property name="port" value="8171"/> </bean>
OK,逐个启动node1-6,done!
注意
参考资料
http://blog.csdn.net/lifetragedy/article/details/51869032
相关文章推荐
- 解析ActiveMQ的使用说明总结
- ActiveMQ在C#中的应用示例分析
- ActiveMQ发消息、收消息、持久化,查询队列剩余消息数、出队数的实现
- activemq报EOFExceptionjvm错误
- ActiveMQ 消息服务(一)
- ActiveMQ 消息服务(二)
- ActiveMQ 消息服务(三)
- Spring+Log4j+ActiveMQ实现远程记录日志——实战+分析
- 基于zookeeper+leveldb搭建activemq集群
- ActiveMQ 实例
- 一台机器上运行多个ActiveMq
- activemq安全设置 设置admin的用户名和密码
- ActiveMQ
- Ubuntu 14.04.1 安装 activemq 5.11.1
- 在Spring中使用ActiveMQ发送邮件
- 多个地市连接MQ,如果较长时间没有消息发送,ActiveMQ的消费端会自动断开连接(topic端)
- 通过Java操作ActiveMQ的代码记录
- 搭建ActiveMQ Master/Slave(LevelDB+Zookeeper)
- 通过spring开发ActiveMQ简单应用
- 【ActiveMQ教程】简介