Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add cluster state file to snapshots created by etcd-rolling-snapshots #2222

Closed
superseb opened this issue Aug 27, 2020 · 1 comment
Closed
Assignees
Labels

Comments

@superseb
Copy link
Contributor

superseb commented Aug 27, 2020

This is a follow up on #1336

As there is no source to copy the state file from, we need to retrieve it from the cluster and add it to the snapshot archive.

gz#12870

@superseb superseb self-assigned this Sep 22, 2020
@maggieliu maggieliu added this to the v1.2.3 - Rancher v2.5.3 milestone Oct 22, 2020
@sowmyav27 sowmyav27 assigned sowmyav27 and unassigned sadiapoddar Dec 10, 2020
@sowmyav27
Copy link

sowmyav27 commented Dec 11, 2020

On Running RKE version: v1.2.3

  • Deploy a cluster. Configure recurring snapshots to occur every 1 hour.
  • When a snapshot is available, do an etcd snapshot restore
  • Snapshot takes the statefile from the local
 ./rke etcd snapshot-restore --name 2020-12-11T01:17:11Z_etcd
INFO[0000] Running RKE version: v1.2.3                  
INFO[0000] Checking if state file is included in snapshot file for [2020-12-11T01:17:11Z_etcd] 
INFO[0000] [dialer] Setup tunnel for host [ip-1] 
INFO[0001] Image [rancher/rke-tools:v0.1.66] exists on host [ip-1] 
INFO[0002] Starting container [etcd-extract-statefile] on host [ip-1], try #1 
INFO[0002] Successfully started [etcd-extract-statefile] container on host [ip-1] 
INFO[0002] Waiting for [etcd-extract-statefile] container to exit on host [ip-1] 
INFO[0002] Waiting for [etcd-extract-statefile] container to exit on host [ip-1] 
INFO[0002] Could not extract state file from snapshot [2020-12-11T01:17:11Z_etcd] on host [ip-1] 
INFO[0002] Could not extract state file from snapshot [2020-12-11T01:17:11Z_etcd] on any host, falling back to local state file: Unable to find statefile in snapshot [2020-12-11T01:17:11Z_etcd] 

Using rke version - v1.2.4-rc3

Use case#1

  • Deploy a cluster. Configure recurring snapshots to occur every 1 hour.
  • When a snapshot is available, do an etcd snapshot restore
  • Snapshot takes the statefile from the snapshot on the etcd node
./rke etcd snapshot-restore --name 2020-12-11T01:19:36Z_etcd
WARN[0000] This is not an officially supported version (v1.2.4-rc3) of RKE. Please download the latest official release at https://github.com/rancher/rke/releases 
INFO[0000] Running RKE version: v1.2.4-rc3              
INFO[0000] Checking if state file is included in snapshot file for [2020-12-11T01:19:36Z_etcd] 
INFO[0000] [dialer] Setup tunnel for host [ip-1] 
INFO[0001] Removing container [etcd-extract-statefile] on host [ip-1], try #1 
INFO[0001] [remove/etcd-extract-statefile] Successfully removed container on host [ip-1] 
INFO[0001] Image [rancher/rke-tools:v0.1.67] exists on host [ip-1] 
INFO[0001] Starting container [etcd-extract-statefile] on host [ip-1], try #1 
INFO[0002] Successfully started [etcd-extract-statefile] container on host [ip-1] 
INFO[0002] Waiting for [etcd-extract-statefile] container to exit on host [ip-1] 
INFO[0002] Waiting for [etcd-extract-statefile] container to exit on host [ip-1] 
INFO[0002] Removing container [etcd-extract-statefile] on host [ip-1], try #1 
INFO[0002] [remove/etcd-extract-statefile] Successfully removed container on host [ip-1] 
INFO[0002] State file is successfully extracted from snapshot [2020-12-11T01:19:36Z_etcd] 

Usecase#2

  • Remove the statefile from the zipped folder of the recurring snapshot on the etcd, and zip it back,
  • do an etcd snapshot restore from this zip file.
  • Message seen while restore:
  • And Snapshot takes the statefile from the local
Could not extract state file from snapshot [2020-12-11T01:19:36Z_etcd] on any host, falling back to local state file: Unable to find statefile in snapshot [2020-12-11T01:19:36Z_etcd] 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants