Help in etcdctl backup restoration +++++++++++++++++++++++++ With the below comm . . .

Shivesh:
Help in etcdctl backup restoration
+++++++++++++++++++++++++
With the below command Backup completed successfully.

ETCDCTL_API=3 etcdctl snapshot save /opt/snapshot-pre-boot.db --cacert=/etc/kubernetes/pki/etcd/ca.crt --cert=/etc/kubernetes/pki/etcd/server.crt --key=/etc/kubernetes/pki/etcd/server.key --endpoints=https://10.149.9.6:2379
Snapshot saved at /opt/snapshot-pre-boot.db

While restoring 1st Error -

root@controlplane:~# ETCDCTL_API=3 etcdctl snapshot restore /opt/snapshot-pre-boot.db --cacert=/etc/kubernetes/pki/etcd/ca.crt --cert=/etc/kubernetes/pki/etcd/server.crt --key=/etc/kubernetes/pki/etcd/server.key --endpoints=https://10.149.9.6:2379 --data-dir=/var/lib/etcd-from-backup --initial-cluster=master=https://127.0.0.1:2380 --initial-cluster-token=etcd-cluster-from-backup --initial-advertise-peer-urls=https://127.0.0.1:2380

Error: couldn’t find local name “default” in the initial cluster configuration

Second Error -

root@controlplane:~# ETCDCTL_API=3 etcdctl snapshot restore /opt/snapshot-pre-boot.db --cacert=/etc/kubernetes/pki/etcd/ca.crt --cert=/etc/kubernetes/pki/etcd/server.crt --key=/etc/kubernetes/pki/etcd/server.key --endpoints=https://10.149.9.6:2379 --data-dir=/var/lib/etcd-from-backup --initial-cluster=master=https://127.0.0.1:2380 --initial-cluster-token=etcd-cluster-from-backup --initial-advertise-peer-urls=https://127.0.0.1:2380 /opt/snapshot-pre-boot.db

Error: snapshot restore requires exactly one argument
root@controlplane:~#

For Restoration, I understand we need to specify below 5 parameters

OPTIONS:
–data-dir=“” Path to the data directory
–initial-advertise-peer-urls=“http://localhost:2380” List of this member’s peer URLs to advertise to the rest of the cluster
–initial-cluster=“default=http://localhost:2380” Initial cluster configuration for restore bootstrap
–initial-cluster-token=“etcd-cluster” Initial cluster token for the etcd cluster during restore bootstrap
–name=“default” Human-readable name for this member

Is there a simple way to specify these parameters or what should be the default all the time ?

MuraliKrishna Reddy:
Thank you Shivesh!!

MuraliKrishna Reddy:
For restoring the backup, we may not need all the extra arguments. This is all we probably need. We don’t need to connect to etcd server here again.

ETCDCTL_API=3 etcdctl snapshot restore /opt/snapshot-pre-boot.db --data-dir=/var/lib/your-folder-name-to-restore

Shivesh:
Thank you Murali !
I wanted to initiate separate discussion thread but it went on your certification update !
Apologies for that !