运维开发网

docker activemq集群搭建

运维开发网 https://www.qedev.com 2020-07-15 13:43 出处:网络 作者:运维开发网整理
安装docker 拉取activemq 镜像 docker pull docker.io/webcenter/activemq:latest   docker run -it -d --name myactivemq1 -p 61617:61616 -p 8171:8161 -v /activemq-master-a.xml:/opt/activemq/conf/activemq.xml -v /

安装docker

拉取activemq 镜像

docker pull docker.io/webcenter/activemq:latest

 

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:latest

 

配置

activemq-master-a.xml :

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

0

精彩评论

暂无评论...
验证码 换一张
取 消