Add info on etcd snapshots containing state file

This commit is contained in:
Sebastiaan van Steenis
2020-11-19 16:06:43 +01:00
parent c6e779ff25
commit 87ad677a11
3 changed files with 15 additions and 7 deletions
@@ -35,6 +35,10 @@ The snapshot is stored in `/opt/rke/etcd-snapshots`. If the directory is configu
In the case when multiple etcd nodes exist, any created snapshot is created after the cluster has been health checked, so it can be considered a valid snapshot of the data in the etcd cluster.
_Available as of v1.1.4_
Each snapshot will include the cluster state file in addition to the etcd snapshot file.
### Snapshot Naming
The name of the snapshot is auto-generated. The `--name` option can be used to override the name of the snapshot when creating one-time snapshots with the RKE CLI.
@@ -46,10 +50,11 @@ An example one-time snapshot name is `rke_etcd_snapshot_2020-10-15T16:47:24+02:0
On restore, the following process is used:
1. The snapshot is retrieved from S3, if S3 is configured.
2. The snapshot is unzipped (if zipped).
3. One of the etcd nodes in the cluster serves that snapshot file to the other nodes.
4. The other etcd nodes download the snapshot and validate the checksum so that they all use the same snapshot for the restore.
5. The cluster is restored and post-restore actions will be done in the cluster.
1. The snapshot is unzipped (if zipped).
1. It is checked if the cluster state file is included in the snapshot, if it is included, it will be used instead of the local cluster state file (_Available as of v1.1.4_)
1. One of the etcd nodes in the cluster serves that snapshot file to the other nodes.
1. The other etcd nodes download the snapshot and validate the checksum so that they all use the same snapshot for the restore.
1. The cluster is restored and post-restore actions will be done in the cluster.
## Troubleshooting
@@ -73,7 +73,7 @@ nodes:
### 4. Restore etcd on the New Node from the Backup
> **Prerequisite:** Ensure your `cluster.rkestate` is present before starting the restore, because this contains your certificate data for the cluster.
> **Prerequisite:** If the snapshot was created using RKE v1.1.4 or higher, the cluster state file should be included in the snapshot. The cluster state file will be automatically extracted and used for the restore. If the snapshot was created using RKE v1.1.3 or lower, please ensure your `cluster.rkestate` is present before starting the restore, because this contains your certificate data for the cluster.
After the new node is added to the `cluster.yml`, run the `rke etcd snapshot-restore` to launch `etcd` from the backup:
@@ -23,6 +23,10 @@ The following actions will be performed when you run the command:
The snapshot used to restore your etcd cluster can either be stored locally in `/opt/rke/etcd-snapshots` or from a S3 compatible backend.
_Available as of v1.1.4_
If the snapshot contains the cluster state file, it will automatically be extracted and used for the restore. If you want to force the use of the local state file, you can add `--use-local-state` to the command. If the snapshot was created using an RKE version before v1.1.4, or if the snapshot does not contain a state file, make sure the cluster state file (by default available as `cluster.rkestate`) is present before executing the command.
### Example of Restoring from a Local Snapshot
To restore etcd from a local snapshot, run:
@@ -37,8 +41,6 @@ The snapshot is assumed to be located in `/opt/rke/etcd-snapshots`.
### Example of Restoring from a Snapshot in S3
> **Prerequisite:** Ensure your `cluster.rkestate` is present before starting the restore, because this contains your certificate data for the cluster.
When restoring etcd from a snapshot located in S3, the command needs the S3 information in order to connect to the S3 backend and retrieve the snapshot.
```shell
@@ -60,6 +62,7 @@ $ rke etcd snapshot-restore \
| --- | --- | ---|
| `--name` value | Specify snapshot name | |
| `--config` value | Specify an alternate cluster YAML file (default: `cluster.yml`) [$RKE_CONFIG] | |
| `--use-local-state` | Force the use of the local state file instead of looking for a state file in the snapshot _Available as of v1.1.4_ | |
| `--s3` | Enabled backup to s3 |* |
| `--s3-endpoint` value | Specify s3 endpoint url (default: "s3.amazonaws.com") | * |
| `--access-key` value | Specify s3 accessKey | *|