-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathset_RMQ_local.py
26 lines (18 loc) · 1.01 KB
/
set_RMQ_local.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import soldier
soldier.run("sudo RABBITMQ_NODE_PORT=5673 RABBITMQ_NODENAME=rb1 rabbitmq-server -detached").output
soldier.run("sudo RABBITMQ_NODE_PORT=5674 RABBITMQ_NODENAME=rb2 rabbitmq-server -detached").output
soldier.run("sudo rabbitmqctl -n rb1 stop_app").output
soldier.run("sudo rabbitmqctl -n rb1 reset").output
soldier.run("sudo rabbitmqctl -n rb1 start_app").output
soldier.run("sudo rabbitmqctl -n rb2 stop_app").output
soldier.run("sudo rabbitmqctl -n rb2 reset").output
soldier.run("sudo rabbitmqctl -n rb2 start_app").output
soldier.run("sudo rabbitmqctl -n rb2 stop_app").output
soldier.run("sudo rabbitmqctl -n rb2 join_cluster rb1@ANIKET").output
soldier.run("sudo rabbitmqctl -n rb2 start_app").output
soldier.run(" sudo rabbitmqctl -n rb1 set_policy ha-all \"\" \'{\"ha-mode\":\"all\",\"ha-sync-mode\":\"automatic\"}\'").output
## Some notes:
##Cluster of rabbitMQ nodes set
##HA policy set
## Erlang cookie will as it is be same if we follow AWS guide to form nodes
## HAProxy if used can be configured here