docker activemq集羣搭建

安裝dockerweb

拉取activemq 鏡像spring

docker pull docker.io/webcenter/activemq:latestdocker

 

docker run -it -d --name myactivemq1 -p 61617:61616 -p 8171:8161 -v /activemq-master-a.xml:/opt/activemq/conf/activemq.xml -v /usr/share/activemq1/kahadb:/opt/activemq/data/kahadb docker.io/webcenter/activemq:latest
docker run -it -d --name myactivemq2 -p 61618:61616 -p 8181:8161 -v /activemq-slave-a.xml:/opt/activemq/conf/activemq.xml -v /usr/share/activemq2/kahadb:/opt/activemq/data/kahadb docker.io/webcenter/activemq:latest
docker run -it -d --name myactivemq -p 61616:61616 -p 8161:8161 docker.io/webcenter/activemq:latestapache

 

配置網絡

activemq-master-a.xml :tcp

<transportConnectors>
<!-- DOS protection, limit concurrent connections to 1000 and frame size to 100MB -->
<transportConnector name="openwire" uri="tcp://0.0.0.0:61617?maximumConnections=1000&amp;wireFormat.maxFrameSize=104857600"/>
<transportConnector name="amqp" uri="amqp://0.0.0.0:5672?maximumConnections=1000&amp;wireFormat.maxFrameSize=104857600"/>
<transportConnector name="stomp" uri="stomp://0.0.0.0:61613?maximumConnections=1000&amp;wireFormat.maxFrameSize=104857600"/>
<transportConnector name="mqtt" uri="mqtt://0.0.0.0:1883?maximumConnections=1000&amp;wireFormat.maxFrameSize=104857600"/>
<transportConnector name="ws" uri="ws://0.0.0.0:61614?maximumConnections=1000&amp;wireFormat.maxFrameSize=104857600"/>
</transportConnectors>

<!-- destroy the spring context on shutdown to stop jetty -->
<shutdownHooks>
<bean xmlns="http://www.springframework.org/schema/beans" class="org.apache.activemq.hooks.SpringContextHook" />
</shutdownHooks>
<networkConnectors>
<networkConnector uri="static:(tcp:192.168.1.127:61616)" duplex="true" />
</networkConnectors>
 
 
activemq-slave-a.xml
<transportConnectors>
<!-- DOS protection, limit concurrent connections to 1000 and frame size to 100MB -->
<transportConnector name="openwire" uri="tcp://0.0.0.0:61618?maximumConnections=1000&amp;wireFormat.maxFrameSize=104857600"/>
<transportConnector name="amqp" uri="amqp://0.0.0.0:5672?maximumConnections=1000&amp;wireFormat.maxFrameSize=104857600"/>
<transportConnector name="stomp" uri="stomp://0.0.0.0:61613?maximumConnections=1000&amp;wireFormat.maxFrameSize=104857600"/>
<transportConnector name="mqtt" uri="mqtt://0.0.0.0:1883?maximumConnections=1000&amp;wireFormat.maxFrameSize=104857600"/>
<transportConnector name="ws" uri="ws://0.0.0.0:61614?maximumConnections=1000&amp;wireFormat.maxFrameSize=104857600"/>
</transportConnectors>

<!-- destroy the spring context on shutdown to stop jetty -->
<shutdownHooks>
<bean xmlns="http://www.springframework.org/schema/beans" class="org.apache.activemq.hooks.SpringContextHook" />
</shutdownHooks>
<networkConnectors>
<networkConnector uri="static:(tcp://192.168.1.127:61616)" duplex="true" />
</networkConnectors>
 
 
activemq.xml: 
<transportConnectors>
<!-- DOS protection, limit concurrent connections to 1000 and frame size to 100MB -->
<transportConnector name="openwire" uri="tcp://0.0.0.0:61616?maximumConnections=1000&amp;wireFormat.maxFrameSize=104857600"/>
<transportConnector name="amqp" uri="amqp://0.0.0.0:5672?maximumConnections=1000&amp;wireFormat.maxFrameSize=104857600"/>
<transportConnector name="stomp" uri="stomp://0.0.0.0:61613?maximumConnections=1000&amp;wireFormat.maxFrameSize=104857600"/>
<transportConnector name="mqtt" uri="mqtt://0.0.0.0:1883?maximumConnections=1000&amp;wireFormat.maxFrameSize=104857600"/>
<transportConnector name="ws" uri="ws://0.0.0.0:61614?maximumConnections=1000&amp;wireFormat.maxFrameSize=104857600"/>
</transportConnectors>

<!-- destroy the spring context on shutdown to stop jetty -->
<shutdownHooks>
<bean xmlns="http://www.springframework.org/schema/beans" class="org.apache.activemq.hooks.SpringContextHook" />
</shutdownHooks>
<!-- 配置網絡代理,cluster 節點須要與 master 跟 slave 進行穿透 -->
<networkConnectors>
<networkConnector uri="static:(tcp://192.168.1.127:61617,tcp://192.168.1.127:61618)" duplex="true" />
</networkConnectors>
相關文章
相關標籤/搜索