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.
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.