mirror of
https://github.com/rancher/rke.git
synced 2025-08-19 15:27:35 +00:00
Fix etcd restore issue
This commit is contained in:
parent
20c05ee5ad
commit
f75ab86027
10
README.md
10
README.md
@ -459,17 +459,17 @@ Backups are saved to the following directory: `/opt/rke/etcdbackup/`. Backups ar
|
|||||||
|
|
||||||
RKE also added two commands that for etcd backup management:
|
RKE also added two commands that for etcd backup management:
|
||||||
```
|
```
|
||||||
./rke etcd backup [NAME]
|
./rke etcd backup --name NAME
|
||||||
```
|
```
|
||||||
and
|
and
|
||||||
```
|
```
|
||||||
./rke etcd restore [NAME]
|
./rke etcd restore --name NAME
|
||||||
```
|
```
|
||||||
|
|
||||||
The backup command saves a snapshot of etcd in `/opt/rke/etcdbackup`. This command also creates a container for the backup. When the backup completes, the container is removed.
|
The backup command saves a snapshot of etcd from each etcd nodes in the cluster config file and will save it in `/opt/rke/etcdbackup`. This command also creates a container for the backup. When the backup completes, the container is removed.
|
||||||
|
|
||||||
```
|
```
|
||||||
# ./rke etcd backup --name snapshot
|
# ./rke etcd backup --name snapshot --config cluster.yml
|
||||||
|
|
||||||
INFO[0000] Starting Backup on etcd hosts
|
INFO[0000] Starting Backup on etcd hosts
|
||||||
INFO[0000] [dialer] Setup tunnel for host [x.x.x.x]
|
INFO[0000] [dialer] Setup tunnel for host [x.x.x.x]
|
||||||
@ -490,7 +490,7 @@ INFO[0011] Finished backup on all etcd hosts
|
|||||||
>**Warning:** Restoring an etcd backup deletes your current etcd cluster and replaces it with a new one. Before you run the `etcd restore` command, backup any important data in your current cluster.
|
>**Warning:** Restoring an etcd backup deletes your current etcd cluster and replaces it with a new one. Before you run the `etcd restore` command, backup any important data in your current cluster.
|
||||||
|
|
||||||
```
|
```
|
||||||
./rke etcd restore --name snapshot --config test-aws.yml
|
./rke etcd restore --name snapshot --config cluster.yml
|
||||||
INFO[0000] Starting restore on etcd hosts
|
INFO[0000] Starting restore on etcd hosts
|
||||||
INFO[0000] [dialer] Setup tunnel for host [x.x.x.x]
|
INFO[0000] [dialer] Setup tunnel for host [x.x.x.x]
|
||||||
INFO[0002] [dialer] Setup tunnel for host [y.y.y.y]
|
INFO[0002] [dialer] Setup tunnel for host [y.y.y.y]
|
||||||
|
@ -29,8 +29,9 @@ func SetUpAuthentication(ctx context.Context, kubeCluster, currentCluster *Clust
|
|||||||
backupPlane = ControlPlane
|
backupPlane = ControlPlane
|
||||||
backupHosts = kubeCluster.ControlPlaneHosts
|
backupHosts = kubeCluster.ControlPlaneHosts
|
||||||
} else {
|
} else {
|
||||||
backupPlane = EtcdPlane
|
// Save certificates on etcd and controlplane hosts
|
||||||
backupHosts = kubeCluster.EtcdHosts
|
backupPlane = fmt.Sprintf("%s,%s", EtcdPlane, ControlPlane)
|
||||||
|
backupHosts = hosts.GetUniqueHostList(kubeCluster.EtcdHosts, kubeCluster.ControlPlaneHosts, nil)
|
||||||
}
|
}
|
||||||
log.Infof(ctx, "[certificates] Attempting to recover certificates from backup on [%s] hosts", backupPlane)
|
log.Infof(ctx, "[certificates] Attempting to recover certificates from backup on [%s] hosts", backupPlane)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user