Hi, I'm trying to restore etcd backup from worker node, by running the below com . . .

Mani:
Hi, I’m trying to restore etcd backup from worker node, by running the below command. All the certs i used are proper but still getting error. pls let me know what i’m missing

ETCDCTL_API=3 etcdctl --data-dir=/tmp/etcd-backup --initial-cluster-token=etcd-cluster-1 --initial-advertise-peer-urls=https://172.17.0.12:2380 --initial-cluster=controlplane=https://172.17.0.12:2380 --name=controlplane --endpoints=172.17.0.12:2379 snapshot restore snapshot.db

unnivkn:
Hi Mani…try this & modify your commands accordingly:

##from master node:
##find etcd server ip & use it as end-point in the below restore command:
cat /etc/kubernetes/manifest/kube-apiserver.yaml | grep etcd

–from worker node
ETCDCTL_API=3 etcdctl --endpoints <api-server-ip-you-found-above>:2379
–cert=/etc/kubernetes/pki/etcd/server.crt
–key=/etc/kubernetes/pki/etcd/server.key
–cacert=/etc/kubernetes/pki/etcd/ca.crt
–data-dir=/var/lib/etcd-from-backup snapshot restore <your-bkp-path>/snapshot.db

once restore done, you have to update etcd.yaml hostPath in volumes: section to /var/lib/etcd-from-backup

unnivkn:
One more thing… I think you may need to install etcd client in your worker node to run the above commands

senthil kumar:
@unnivkn how can we install etcd in worker node…have a steps?

unnivkn:
I saw this link… hope this may work. However not sure any additional configuration is needed. I think if it is ask in an exam the worker node might have already installed etcd client. https://www.howtoinstall.me/ubuntu/18-04/etcd-client/

Mani:
Thank you unnivkn, I will try this