Hello diegoashraf,
you should copy the all certificate from the master node to the remote node,
and replace the value of –endpoints,–initial-cluster, and --initial-advertise-peer-urls with the IP-Master-Node
I dont think this will work, Can you please suggest where will the data-dir get created? When i tried the data-dir was getting created in the remote node. If so how do we update the data-dir in the etcd.yaml file
Always fun are etcd questions! There are a few things
You can make a backup from a remote host (e.g. student node) and the backup will be written to the student node. For this you need the endpoint address of the etcd server, and the 2 certs and the key copied locally.
You cannot make a restore from a remote location. In restore mode, etcdctl does not talk to the etcd server, therefore the only argument it respects is --data-dir - and this directory will be created on the node where you are running etcdctl.
Therefore to restore, there are two ways to do it
Copy your snapshot file up to the control plane node or whatever node the etcd server is running on, and run etcdctl restore there.
Run etcdctl restore locally, then make a tarball (.tar.gz file) of the restored directory, copy that to the etcd node, then unzip it there.
Finally, for both methods, update etcd to use the newly created data directory. Why does etcdctl not talk to the etcd server during restore? What if your etcd database was so corrupt that etcd cannot run? How would you restore the backup if it was a requirement to communicate with etcd server? See also https://github.com/kodekloudhub/community-faq/blob/main/docs/etcd-faq.md