diff --git a/parts/kubernetesmastercustomdata.yml b/parts/kubernetesmastercustomdata.yml index de6baf2a8f..708c974607 100644 --- a/parts/kubernetesmastercustomdata.yml +++ b/parts/kubernetesmastercustomdata.yml @@ -342,6 +342,8 @@ runcmd: - sudo /bin/chown -R etcd:etcd /var/lib/etcddisk - systemctl stop etcd - sudo -u etcd rm -rf /var/lib/etcd/default +- sudo /bin/sed -i s/Restart=on-abnormal/Restart=always/g /lib/systemd/system/etcd.service +- systemctl daemon-reload - systemctl restart etcd - for i in $(seq 1 20); do curl --max-time 60 http://127.0.0.1:2379/v2/machines; [ $? -eq 0 ] && break || sleep 5; done - retrycmd_if_failure() { for i in 1 2 3 4 5; do $@; [ $? -eq 0 ] && break || sleep 5; done ; }