File tree 1 file changed +5
-4
lines changed
1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change 4
4
- hosts :
5
5
- localhost
6
6
tasks :
7
- # 寻找etcd集群中第一个健康节点
7
+ # step1: find a healthy member in the etcd cluster
8
8
- name : set NODE_IPS of the etcd cluster
9
9
set_fact : NODE_IPS="{% for host in groups['etcd'] %}{{ host }} {% endfor %}"
10
10
18
18
endpoint health; \
19
19
done'
20
20
register : ETCD_CLUSTER_STATUS
21
+ ignore_errors : true
21
22
22
23
- debug : var="ETCD_CLUSTER_STATUS.stdout"
23
24
27
28
28
29
- debug : var="RUNNING_NODE.stdout"
29
30
30
- # 在健康etcd节点上执行数据备份
31
- - name : 执行etcd 数据备份
31
+ # step2: backup data on the healthy member
32
+ - name : make a backup on etcd node
32
33
shell : " mkdir -p /etcd_backup && cd /etcd_backup && \
33
34
ETCDCTL_API=3 {{ bin_dir }}/etcdctl snapshot save snapshot.db"
34
35
args :
35
36
warn : false
36
37
delegate_to : " {{ RUNNING_NODE.stdout }}"
37
38
38
- - name : 获取etcd 数据备份
39
+ - name : fetch the backup data
39
40
fetch :
40
41
src : /etcd_backup/snapshot.db
41
42
dest : " {{ base_dir }}/.cluster/backup/"
You can’t perform that action at this time.
0 commit comments