'RabbitMQ Clustering with 1Master & 5Nodes

Recently i deployed and implement RabbitMQ with 1Master and 2Nodes (as slaves). Is it possible to clustering RabbitMQ with 1Master and 5Nodes? For the record in 1Master-2Nodes i used commands below and it works like a charm.

sudo rabbitmqctl set_policy ha-all ".*" '{"ha-mode":"all"}'

sudo rabbitmqctl set_policy ha-two "^two\." \
       '{"ha-mode":"exactly","ha-params":2,"ha-sync-mode":"automatic"}'

sudo rabbitmqctl set_policy ha-nodes "^nodes\." \
   '{"ha-mode":"nodes","ha-params":["rabbit@node02", "rabbit@node03"]}'

RabbitMQ Clustering (1 Master{node01} and 2 Slaves{node02,node03}

What changes should i perform on commands above to get my point? The point is RabbitMQ with 1Master and 5Nodes. Thank you so much for helping me.



Solution 1:[1]

By the way i find the solution and it was very simple.

$ sudo rabbitmqctl set_policy ha-two "^five\." \
 '{"ha-mode":"exactly","ha-params":5,"ha-sync-mode":"automatic"}'

$ sudo rabbitmqctl set_policy ha-nodes "^nodes\." \
'{"ha-mode":"nodes","ha-params":["rabbit@node02",rabbit@node03""rabbit@node04", "rabbit@node05", "rabbit@node06"]}'

That's it.should add the remaining nodes as ha-nodes and let the rabbitmq-server set_policy ha-five with ha-params 5 (on the first command above).
After that should introduce the node{02..06} to to ha-nodes via set_policy in the second command.
The image below is the final result:
RabbitMQ Clustering with 1Master & 5Nodes

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Matthew Neghabi