Jeepyb User | dd14e0b | 2017-02-28 15:19:32 +0000 | [diff] [blame] | 1 | #!/bin/bash -x |
| 2 | exec > >(tee -i /tmp/"$(basename "$0" .sh)"_"$(date '+%Y-%m-%d_%H-%M-%S')".log) 2>&1 |
| 3 | |
| 4 | # Install keepaliveds |
| 5 | salt -C 'I@keepalived:cluster' state.sls keepalived -b 1 |
| 6 | # Check the VIPs |
| 7 | salt -C 'I@keepalived:cluster' cmd.run "ip a | grep 172.16.10.2" |
| 8 | |
| 9 | # Install gluster |
| 10 | salt -C 'I@glusterfs:server' state.sls glusterfs.server.service |
| 11 | salt -C 'I@glusterfs:server' state.sls glusterfs.server.setup -b 1 |
| 12 | # Check the gluster status |
| 13 | salt -C 'I@glusterfs:server' cmd.run "gluster peer status; gluster volume status" -b 1 |
| 14 | |
| 15 | # Install rabbitmq |
| 16 | salt -C 'I@rabbitmq:server' state.sls rabbitmq |
| 17 | # Check the rabbitmq status |
| 18 | salt -C 'I@rabbitmq:server' cmd.run "rabbitmqctl cluster_status" |
| 19 | |
| 20 | # Install galera |
| 21 | salt -C 'I@galera:master' state.sls galera |
| 22 | salt -C 'I@galera:slave' state.sls galera |
| 23 | # Check galera status |
| 24 | salt -C 'I@galera:master' mysql.status | grep -A1 wsrep_cluster_size |
| 25 | salt -C 'I@galera:slave' mysql.status | grep -A1 wsrep_cluster_size |
| 26 | |
| 27 | # Install haproxy |
| 28 | salt -C 'I@haproxy:proxy' state.sls haproxy |
| 29 | salt -C 'I@haproxy:proxy' service.status haproxy |
| 30 | salt -I 'haproxy:proxy' service.restart rsyslog |
| 31 | |
| 32 | # Install memcached |
| 33 | salt -C 'I@memcached:server' state.sls memcached |