clustering.rst 993 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. Clustering
  2. ==========
  3. Suppose we cluster two nodes on hosts:
  4. Node | Host | IpAddress
  5. -----|--------|-------------
  6. node1(disc_copy)| host1 | 192.168.0.10
  7. node2(ram_copy) | host2 | 192.168.0.20
  8. Configure and start 'node1'
  9. ---------------------------
  10. configure 'etc/vm.args'::
  11. -name emqttd@192.168.0.10
  12. If host1, host2 added to /etc/hosts of OS::
  13. -name emqttd@host1
  14. Start node1::
  15. ./bin/emqttd start
  16. .. NOTE:: Notice that data/mnesia/* should be removed before you start the broker with different node name.
  17. Configure and start 'node2'
  18. ---------------------------
  19. Configure 'etc/vm.args'::
  20. -name emqttd@192.168.0.20
  21. or::
  22. -name emqttd@host2
  23. Then start node2::
  24. ./bin/emqttd start
  25. Cluster two nodes
  26. ---------------------------
  27. Run './bin/emqttd_ctl cluster' on host2::
  28. ./bin/emqttd_ctl cluster emqttd@192.168.0.10
  29. Check cluster status
  30. ---------------------------
  31. And then check clustered status on any host::
  32. ./bin/emqttd_ctl cluster