Skip to content

Instantly share code, notes, and snippets.

@jgreat
Last active July 17, 2018 11:31
Show Gist options
  • Save jgreat/e5482ee259267584710da185ae67c921 to your computer and use it in GitHub Desktop.
Save jgreat/e5482ee259267584710da185ae67c921 to your computer and use it in GitHub Desktop.
Rancher 2.0 DR Test

Create snapshots and copy to localhost.

rke etcd snapshot-save --name test.db

export SOURCE=52.15.238.179

scp ubuntu@${SOURCE}:/opt/rke/etcd-snapshots/test.db ../../
scp ubuntu@${SOURCE}:/opt/rke/etcd-snapshots/pki.bundle.tar.gz ../../

Copy Snapshots to one node

export TARGET=52.15.212.134

scp ../../test.db ubuntu@${TARGET}:/tmp
scp ../../pki.bundle.tar.gz ubuntu@${TARGET}:/tmp

ssh ubuntu@${TARGET}
sudo su -
mkdir -p /opt/rke/etcd-snapshots
cp /tmp/test.db /opt/rke/etcd-snapshots
cp /tmp/pki.bundle.tar.gz /opt/rke/etcd-snapshots

Restore snapshot to single node

rke etcd snapshot-restore --name test.db
rke up

Swap dns/load balancers to new cluster

Delete dead nodes

kubectl get nodes                   
NAME            STATUS     ROLES                      AGE       VERSION
52.15.212.134   Ready      controlplane,etcd,worker   4m        v1.10.5
52.15.238.179   NotReady   controlplane,etcd,worker   36m       v1.10.5

kubectl delete node 52.15.238.179
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment