Hi, team. I'd like to ask you about the restore db questions. Do I need to modif . . .

LongKang Fan:
Hi, team. I’d like to ask you about the restore db questions. Do I need to modify the --data-dir option in the manifest file of etcd after ran the ETCDCTL_API=3 etcdctl snapshot restore --cacert=/etc/kubernetes/pki/etcd/ca.crt --cert=/etc/kubernetes/pki/etcd/server.crt --key=/etc/kubernetes/pki/etcd/server.key --data-dir=/root/default.etcd /opt/cluster1_backup_to_restore.db command?

Alex Novik:
sure, otherwise etcd will not pickup restore you made

LongKang Fan:
But if I change the --data-dir option from origin into /root/default.etcd then save the changes. The cluster is broken… I have encountered this question for few times. I saw the answer, it ends after the snapshot restore command… I am so confused.

Alex Novik:
it will take some time to reboot etcd pod after the change is made
when you update manifests static pods are rebooted to take effect

Alex Novik:
probably it is not required in the lab, but in real life if you restore DB with snapshot restore to another directory you should change --data-dir in the manifest file

LongKang Fan:
Yeah, I know. But after the reboot, some other env were broken like wave cni and kubelet process…

LongKang Fan:
I agree with you. Let’s see what the staff will say about the lab questions.

LongKang Fan:
OH man… I made a mistake… I do not need to change the --data-dir option in the yaml file. All I need to do is change the path in the volumes section… I forgot about this…

Alistair Mackay:
https://github.com/kodekloudhub/community-faq/blob/main/docs/etcd-faq.md#how-do-i-restore-a-backup