From e050e7a867a1fc1d25cb0755d270cc82effb33f4 Mon Sep 17 00:00:00 2001 From: Wojciech Tyczynski Date: Tue, 16 May 2017 09:42:26 +0200 Subject: [PATCH] Fix etcd migration for HA clusters --- cluster/images/etcd/migrate-if-needed.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/cluster/images/etcd/migrate-if-needed.sh b/cluster/images/etcd/migrate-if-needed.sh index 04c57157a0..5f19651464 100755 --- a/cluster/images/etcd/migrate-if-needed.sh +++ b/cluster/images/etcd/migrate-if-needed.sh @@ -122,7 +122,6 @@ start_etcd() { ${ETCD_CMD} \ --name="etcd-$(hostname)" \ --debug \ - --force-new-cluster \ --data-dir=${DATA_DIRECTORY} \ --listen-client-urls http://127.0.0.1:${ETCD_PORT} \ --advertise-client-urls http://127.0.0.1:${ETCD_PORT} \ @@ -154,7 +153,7 @@ ROLLBACK="${ROLLBACK:-/usr/local/bin/rollback}" # If we are upgrading from 2.2.1 and this is the first try for upgrade, # do the backup to allow restoring from it in case of failed upgrade. BACKUP_DIR="${DATA_DIRECTORY}/migration-backup" -if [ "${CURRENT_VERSION}" = "2.2.1" -a ! "${CURRENT_VERSION}" != "${TARGET_VERSION}" -a -d "${BACKUP_DIR}" ]; then +if [ "${CURRENT_VERSION}" = "2.2.1" -a "${CURRENT_VERSION}" != "${TARGET_VERSION}" -a ! -d "${BACKUP_DIR}" ]; then echo "Backup etcd before starting migration" mkdir ${BACKUP_DIR} ETCDCTL_CMD="/usr/local/bin/etcdctl-2.2.1"