Hailu Meng:
What’s the benefit to specify a different data-dir for etcd restore instead of using default /var/lib/etcd?
Vitor Jr.:
You can keep you current data without overwrite it
Vitor Jr.:
Specially if you aren’t sure about which one (PITR) do you want to restore
Hailu Meng:
Thanks @Vitor Jr. , so you still have the original db in default folder and you can revert it back if you want to. I did try without data-dir option, the result was odd since the pod created after the backup still shows up after the restore. That doesn’t make sense if the original data is overwritten by the backup db. It seems like the new data still lives in default folder after the restore. The pod status did change to error state though.
unnivkn:
Hi @Hailu Meng please restart the etcd & try to check again. If that not works, you can try to manually relocate the data inside the data-dir to some new directory & make the data-dir empty before restore. Then try to restore from backup & see how it works for you.
Hailu Meng:
Thanks @unnivkn . Can I say it should restore to previous state even we don’t use data-dir for new path?
unnivkn:
yup… it’s should restore to the original directory /var/lib/etcd & it should not show up the pods you created after the etcd backup.
Hailu Meng:
Thanks @unnivkn . I will give it try. I know it’s not good way for production but like to save some time in the test if possible. Also I will try not to change the mountpath and data-dir in yaml file since that’s only valid for the pod itself. It shouldn’t matter as long as the hostpath points to the right data.