mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-27 21:47:07 +00:00
Fix etcd migration for HA clusters
This commit is contained in:
parent
42a73ee3ac
commit
e050e7a867
@ -122,7 +122,6 @@ start_etcd() {
|
|||||||
${ETCD_CMD} \
|
${ETCD_CMD} \
|
||||||
--name="etcd-$(hostname)" \
|
--name="etcd-$(hostname)" \
|
||||||
--debug \
|
--debug \
|
||||||
--force-new-cluster \
|
|
||||||
--data-dir=${DATA_DIRECTORY} \
|
--data-dir=${DATA_DIRECTORY} \
|
||||||
--listen-client-urls http://127.0.0.1:${ETCD_PORT} \
|
--listen-client-urls http://127.0.0.1:${ETCD_PORT} \
|
||||||
--advertise-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,
|
# 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.
|
# do the backup to allow restoring from it in case of failed upgrade.
|
||||||
BACKUP_DIR="${DATA_DIRECTORY}/migration-backup"
|
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"
|
echo "Backup etcd before starting migration"
|
||||||
mkdir ${BACKUP_DIR}
|
mkdir ${BACKUP_DIR}
|
||||||
ETCDCTL_CMD="/usr/local/bin/etcdctl-2.2.1"
|
ETCDCTL_CMD="/usr/local/bin/etcdctl-2.2.1"
|
||||||
|
Loading…
Reference in New Issue
Block a user