Files
sf_databuffer/operation-tools/restart_cluster.yml
2021-03-17 12:15:59 +01:00

109 lines
2.2 KiB
YAML

- name: stop data api
hosts: data_api
become: true
tasks:
- name: stop data-api
systemd:
state: stopped
name: data-api
- name: stop nginx
systemd:
state: stopped
name: nginx
- name: stop dispatcher api
hosts: dispatcher_api
become: true
tasks:
- name: stop dispatcher-api
systemd:
state: stopped
name: dispatcher-api
- name: stop nginx
systemd:
state: stopped
name: nginx
- name: stop nodes
hosts: databuffer_cluster
become: true
tasks:
- name: stop daq-dispatcher-node
systemd:
state: stopped
name: daq-dispatcher-node
- name: stop daq-query-node
systemd:
state: stopped
name: daq-query-node
- name: Remove sources
file:
path: /home/daqusr/.config/daq/stores/sources
state: absent
- name: Remove streamers
file:
path: /home/daqusr/.config/daq/stores/streamers
state: absent
# IMPORTANT: It is necessary to bring up the dispatcher node processes first
# before starting the query node processes!
- name: start dispatcher nodes
hosts: databuffer_cluster
become: true
# serial: 1
tasks:
- name: start daq-dispatcher-node
systemd:
state: started
name: daq-dispatcher-node
- name: wait for dispatcher nodes to come up
hosts: dispatcher_api
tasks:
- name: sleep for 120 seconds and continue with play
wait_for:
timeout: 120
- name: start query nodes
hosts: databuffer_cluster
become: true
# serial: 1
tasks:
- name: start daq-query-node
systemd:
state: started
name: daq-query-node
- name: start data api
hosts: data_api
become: true
tasks:
- name: start data-api
systemd:
state: started
name: data-api
- name: start nginx
systemd:
state: started
name: nginx
- name: start dispatcher api
hosts: dispatcher_api
become: true
tasks:
- name: start dispatcher-api
systemd:
state: started
name: dispatcher-api
- name: start nginx
systemd:
state: started
name: nginx