How to configure VerneMQ Cluster using Docker Container?

Hi All

I am having problem configuring VerneMQ Cluster using Docker Container.

Here my environment setup

  1. Two virtual servers of IP 10.122.47.63 and 10.222.47.64

  2. Docker version 20.10.12 has been installed on virtual server.

  3. Follow the step from Running VerneMQ using Docker - VerneMQ

  4. For Virtual server IP 10.122.47.63, I ran the command
    docker run -p 1883:1883 -p 8888:8888 --name vernemqcluster1 -e “DOCKER_VERNEMQ_ACCEPT_EULA=yes” -e “DOCKER_VERNEMQ_ALLOW_ANONYMOUS=on” -e “SHARED_SUBSCRIPTION_POLICY=prefer_local” -d vernemq/vernemq &

  5. For Virtual server IP 10.122.47.64, I ran the command
    docker run -p 1883:1883 -p 8888:8888 --name vernemqcluster2 -e “DOCKER_VERNEMQ_DISCOVERY_NODE=10.122.47.63” -e “DOCKER_VERNEMQ_ACCEPT_EULA=yes” -e “DOCKER_VERNEMQ_ALLOW_ANONYMOUS=on” -e “SHARED_SUBSCRIPTION_POLICY=prefer_local” -d vernemq/vernemq &

Is this correct ?

When I run command docker exec vernemqcluster1 vmq-admin cluster show
it output as
±-------------------±--------+
| Node | Running |
±-------------------±--------+
| VerneMQ@172.17.0.3 | true |
±-------------------±--------+

which is not correct.

Can you please let me know what I am missing.

Thank you for your help and Support

Regards, Bao

4 Likes

You need to address the discovery_node using the internal Docker network IP instead of those virtual server IPs. See note here: Running VerneMQ using Docker - VerneMQ

I hope this helps.

4 Likes

Thank you

2 Likes