raft_group_setup.tpl 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. #!/bin/bash
  2. #############################################################################
  3. # Setting up the raft groups
  4. #
  5. # IPS:
  6. # ${node1}
  7. # ${node2}
  8. # ${node3}
  9. #
  10. # Run once from from any node
  11. #############################################################################
  12. # setup clusters
  13. redis-cli -h ${node1} -p 19901 raft.cluster init
  14. redis-cli -h ${node1} -p 19902 raft.cluster init
  15. redis-cli -h ${node1} -p 19903 raft.cluster init
  16. redis-cli -h ${node1} -p 19904 raft.cluster init
  17. redis-cli -h ${node2} -p 19905 raft.cluster init
  18. redis-cli -h ${node2} -p 19906 raft.cluster init
  19. redis-cli -h ${node2} -p 19907 raft.cluster init
  20. redis-cli -h ${node2} -p 19908 raft.cluster init
  21. redis-cli -h ${node3} -p 19909 raft.cluster init
  22. redis-cli -h ${node3} -p 19910 raft.cluster init
  23. redis-cli -h ${node3} -p 19911 raft.cluster init
  24. redis-cli -h ${node3} -p 19912 raft.cluster init
  25. # setup groups
  26. redis-cli -h ${node2} -p 19901 raft.cluster join ${node1}:19901
  27. redis-cli -h ${node3} -p 19901 raft.cluster join ${node1}:19901
  28. redis-cli -h ${node2} -p 19902 raft.cluster join ${node1}:19902
  29. redis-cli -h ${node3} -p 19902 raft.cluster join ${node1}:19902
  30. redis-cli -h ${node2} -p 19903 raft.cluster join ${node1}:19903
  31. redis-cli -h ${node3} -p 19903 raft.cluster join ${node1}:19903
  32. redis-cli -h ${node2} -p 19904 raft.cluster join ${node1}:19904
  33. redis-cli -h ${node3} -p 19904 raft.cluster join ${node1}:19904
  34. redis-cli -h ${node1} -p 19905 raft.cluster join ${node2}:19905
  35. redis-cli -h ${node3} -p 19905 raft.cluster join ${node2}:19905
  36. redis-cli -h ${node1} -p 19906 raft.cluster join ${node2}:19906
  37. redis-cli -h ${node3} -p 19906 raft.cluster join ${node2}:19906
  38. redis-cli -h ${node1} -p 19907 raft.cluster join ${node2}:19907
  39. redis-cli -h ${node3} -p 19907 raft.cluster join ${node2}:19907
  40. redis-cli -h ${node1} -p 19908 raft.cluster join ${node2}:19908
  41. redis-cli -h ${node3} -p 19908 raft.cluster join ${node2}:19908
  42. redis-cli -h ${node1} -p 19909 raft.cluster join ${node3}:19909
  43. redis-cli -h ${node2} -p 19909 raft.cluster join ${node3}:19909
  44. redis-cli -h ${node1} -p 19910 raft.cluster join ${node3}:19910
  45. redis-cli -h ${node2} -p 19910 raft.cluster join ${node3}:19910
  46. redis-cli -h ${node1} -p 19911 raft.cluster join ${node3}:19911
  47. redis-cli -h ${node2} -p 19911 raft.cluster join ${node3}:19911
  48. redis-cli -h ${node1} -p 19912 raft.cluster join ${node3}:19912
  49. redis-cli -h ${node2} -p 19912 raft.cluster join ${node3}:19912