-
Notifications
You must be signed in to change notification settings - Fork 105
Update backup_restore.md #321
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -52,9 +52,13 @@ rke2 server \ | |||||||||||||
| systemctl start rke2-server | ||||||||||||||
| ``` | ||||||||||||||
|
|
||||||||||||||
| 4. Remove the rke2 db directory on the other server nodes as follows: | ||||||||||||||
| 4. Move the rke2 db directory on the other server nodes as follows (you want to keep a copy to avoid ending up with only an old or corrupt backup to chose for): | ||||||||||||||
| ``` | ||||||||||||||
| rm -rf /var/lib/rancher/rke2/server/db | ||||||||||||||
| mv /var/lib/rancher/rke2/server/db /var/lib/rancher/rke2/server/backups | ||||||||||||||
| ``` | ||||||||||||||
| Clean them out after this operation: | ||||||||||||||
| ``` | ||||||||||||||
| rm -rf /var/lib/rancher/rke2/server/backups | ||||||||||||||
|
Comment on lines
+57
to
+61
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
This should remove the etcd files but leave the snapshots, without requiring any additional cleanup later.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this is good, unless I'm missing anything; @mattmattox? |
||||||||||||||
| ``` | ||||||||||||||
|
|
||||||||||||||
| 5. Start the rke2-server service on other server nodes with the following command: | ||||||||||||||
|
|
||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Having the old DB dir around on the secondary servers doesn't really help with anything. If you run into problems, restoring a snapshot is a better resolution than moving an old db dir back into place.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The issue is that we currently run
rm -rf /var/lib/rancher/rke2/server/db/, which deletes both the etcd data and the snapshots directory. This means we erase the live data along with its backups.We've encountered cases where customers, not paying close attention, have accidentally executed this command on all three master/etcd nodes, leading to complete data loss.
This change ensures that snapshots are not deleted until the cluster has been fully restored, allowing customers to perform the cleanup on their own afterward.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, then how about we leave this as-is and just delete the etcd directory?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@brandond @Tejeev
I agree with the proposed change to use
rm -rf /var/lib/rancher/rke2/server/db/etcdinstead of the broader directory removal.The more targeted approach addresses the core issue while providing several important benefits: