i am a new user in MQTT, and would to create a vernemq cluster of three nodes , how can i do this ? (with mosquitto client) please . I have try to do it with the bridge in two distinct VM on ubuntu 18 but i haven't succes .
2 Answers
First you need to have 3 running VerneMQ nodes. Then you'll join one node to the other like this:
vmq-admin cluster join discovery-node=<OtherClusterNode>
Then you check the cluster state (you should see a 2 node cluster):
vmq-admin cluster show
Then you repeat the first command and join the 3rd node to the cluster (the discovery-node can be any node in the existing cluster).
Note: your VerneMQ nodes need to be configured correctly, namely with regard to configured listeners and ports. See here: https://vernemq.com/docs/clustering/communication.html
If you use cloud VMs/Docker or similar, make sure you configure access accordingly.

- 356
- 1
- 4
-
thank you for your quick answer ,i tried to create more of node on the same computer like : vernemq.config $ nodename = VerneMQ@192.168.0.1 $ nodename = VerneMQ2@192.168.0.2 $ nodename = VerneMQ3@192.168.0.3 $ nodename = VerneMQ4@192.168.0.4 but i had this error $ vernemq failed to start within 15 $ see the output of 'vernemq console' for more $ If you want to wait longer, set the environment $ WAIT_FOR_ERLANG to the number of seconds to wait. – J.Goe Jun 14 '18 at 19:25
-
This should be part of the documentation of the VerneMQ clustering guide. Thank you so much! – thepanuto May 24 '19 at 13:36
-
1Thanks, @thepanuto. Added some documentation here as requested: https://docs.vernemq.com/misc/clustering-during-development – André F. May 29 '19 at 09:24
You need to take care of a couple things if you want to run multiple VerneMQ instances on the same machine. There is a make
option that let's you build multiple releases, as a commodity. This will prepare 3 correctly configured vernemq.conf files, with different ports for the MQTT listeners etc.
➜ default git:(master) ✗ make dev1 dev2 dev3
This will prepare different vernemq.conf files in the respective release builds. (look at them in the _build
directory after having built the releases.)
You can then start the respective broker instances in 3 terminal windows. Hope this helps.
EDIT: can't comment yet, so had to add this as an answer.

- 356
- 1
- 4