From 587438e61d8e28873b7b780bafbf363d24a6728b Mon Sep 17 00:00:00 2001 From: Mumshad Mannambeth Date: Fri, 3 May 2019 12:44:31 +0800 Subject: [PATCH] Update etcd-backup-and-restore.md --- .../etcd-backup-and-restore.md | 23 ++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/practice-questions-answers/etcd-backup-and-restore.md b/practice-questions-answers/etcd-backup-and-restore.md index 5dcaa94..f9d7ac4 100644 --- a/practice-questions-answers/etcd-backup-and-restore.md +++ b/practice-questions-answers/etcd-backup-and-restore.md @@ -2,8 +2,27 @@ # 1. Get etcdctl utility if it's not already present. +Reference: https://github.com/etcd-io/etcd/releases + ``` -go get github.com/coreos/etcd/etcdctl +ETCD_VER=v3.3.13 + +# choose either URL +GOOGLE_URL=https://storage.googleapis.com/etcd +GITHUB_URL=https://github.com/etcd-io/etcd/releases/download +DOWNLOAD_URL=${GOOGLE_URL} + +rm -f /tmp/etcd-${ETCD_VER}-linux-amd64.tar.gz +rm -rf /tmp/etcd-download-test && mkdir -p /tmp/etcd-download-test + +curl -L ${DOWNLOAD_URL}/${ETCD_VER}/etcd-${ETCD_VER}-linux-amd64.tar.gz -o /tmp/etcd-${ETCD_VER}-linux-amd64.tar.gz +tar xzvf /tmp/etcd-${ETCD_VER}-linux-amd64.tar.gz -C /tmp/etcd-download-test --strip-components=1 +rm -f /tmp/etcd-${ETCD_VER}-linux-amd64.tar.gz + +/tmp/etcd-download-test/etcd --version +ETCDCTL_API=3 /tmp/etcd-download-test/etcdctl version + +mv /tmp/etcd-download-test/etcdctl /usr/bin ``` # 2. Backup @@ -33,6 +52,8 @@ ETCDCTL_API=3 etcdctl --endpoints=https://[127.0.0.1]:2379 --cacert=/etc/kuberne # 4. Modify /etc/kubernetes/manifests/etcd.yaml +Update ETCD POD to use the new data directory and cluster token by modifying the pod definition file at `/etc/kubernetes/manifests/etcd.yaml`. When this file is updated, the ETCD pod is automatically re-created as thisis a static pod placed under the `/etc/kubernetes/manifests` directory. + Update --data-dir to use new target location ```