Practice Test Backup and Restore Methods 2: Qn 15

Hey guys, I seem to have some problems with this question.

Hope yall can help me out :slight_smile:

This is the error I’m getting:

And this is the sequence of commands I have tried:

In student-node:
alias "e=etcdctl" && alias "k=kubectl" && \
export "ETCDCTL_API=3"

scp /opt/cluster2.db etcd-server:/opt/cluster2.db

In etcd-server:
e snapshot restore /opt/cluster2.db \
--data-dir=/var/lib/etcd-backup
chown -R etcd:etcd /var/lib/etcd-backup
vi /etc/systemd/system/etcd.service (to change the --data-dir)
systemctl daemon-reload
systemctl restart etcd

In student-node:

//1st attempt to check answer. Failed.
kubectl config use-context cluster2
k delete -n kube-system po kube-apiserver-cluster2-controlplane

//2nd attempt to check answer. Failed.

In custer2-controlplane:
systemctl restart kubelet.service
systemctl status kubelet.service

//3rd attempt to check answer. Still failed.

Hi @enkaveen999,

You’re not restored to the right folder. You restore to folder /var/lib/etcd-backup you need to restore it to folder /var/lib/etcd-data-new

Hello @mmkmou,

Hmm, I don’t think that’s the problem since I update the etcd.service unit file appropriately as shown:
image

Hi,

you need to restore it to /var/lib/etcd-backup-new no /var/lib/etcd-backup

Hi,

May I know why the naming is a game changer here?

I assumed that one can use any name as long as it is consistent throughout.

Hope you can explain on that :slight_smile:

Hi,

Because it’s asked on the task

If you prepare the CKA, you need to take care of this kind of detail. The Exam is not difficult himself, but you need to take care of detail.

Hello,

Apologies, I assumed it could be any new directory of my choice.

But now it makes sense to to use etcd-data-new as that’s the probably the only way for the system to reasonably to check if I have created the directory.

Thanks!