subject line: setup activemq cluster in docker swarm .
Problem Summary: - Unable to create a setup with two active-active activemq nodes in docker swarm. so need your help to setup that. following are the details of setup I am trying to create.
Details: Trying to create two node activemq cluster (not AMQ Artemis) in docker swarm setup. docker version is 19.03.12 following vms used to setup my application.
- node-infra - This vm is swarm leader and has "activemq" container
- node-infra2 -This vm is another swarm leader and has "activemq" container.
- node-app - This vm is worker node which has my application running.
root@node-infra:~# docker node ls
ID HOSTNAME STATUS AVAILABILITY MANAGER STATUS ENGINE VERSION
ypzb7jmys3qzyea5r4r1te5b6 node-app Ready Active 19.03.12
byuar7z0uphd01zlujy9iy0n1 * node-infra Ready Active Leader 19.03.12
tvjzzlamc29gzrsnq3xn3e58w node-infra2 Ready Active Reachable 19.03.12
created following overlay docker network in this setup. docker network create --driver=overlay --subnet=192.168.1.0/24 --attachable mynetwork
Used following command to start activemq containers in both node-infra nodes. docker run -d --restart unless-stopped --net mynetwork --log-opt mode=non-blocking --log-opt max-buffer-size=4m -p 61616:61616 -p 8161:8161 --name activemq rmohr/activemq:5.15.3-alpine
rest of the entries are default but following entries are changed.
activemq.xml entries are as below for node-infra node
<broker xmlns="http://activemq.apache.org/schema/core" brokerName="master_infra" brokerId="master_id_infra" dataDirectory="${activemq.data}" schedulerSupport="true">
<networkConnectors>
<networkConnector name="default-nc" prefetchSize="10" uri="multicast://default" />
</networkConnectors>
<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&wireFormat.maxFrameSize=104857600" rebalanceClusterClients="true" updateClusterClients="true" discoveryUri="multicast://default"/>
</transportConnectors>
similarly for node-infra2 following are the activemq.xml entries.
<broker xmlns="http://activemq.apache.org/schema/core" brokerName="master_infra2" brokerId="master_id_infra2" dataDirectory="${activemq.data}" schedulerSupport="true">
<networkConnectors>
<networkConnector name="default-nc" prefetchSize="10" uri="multicast://default" />
</networkConnectors>
<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&wireFormat.maxFrameSize=104857600" rebalanceClusterClients="true" updateClusterClients="true" discoveryUri="multicast://default"/>
</transportConnectors>
when I start container activemq on node-infra and activemq on node-infra2 . eventhough I have enabled multicast discovery, both containers are not able to establish connection with eachother. there is no error in log , but it doesnt sense that there is another activemq container with multicast discovery enabled.
when I did this setup directly on vm without containers, it works as expected both activemq instances share messaged over multicast network. but not happening with docker containers.
Can someone please help on this. let me know if more info required to reproduce.