Closed olivierHa closed 2 months ago
This runs without issues, but it seems to remove only the snapshot on one node only : On another etcd node, the snapshot directory is full :
Snapshots are stored locally on each node. Pruning on one node only removes snapshots from that node. What did you see in the docs that made you expect that running the prune command on one node would also have any effect on other nodes?
the documentation here tells us to run the following command : rke2 etcd-snapshot prune --snapshot-retention
When running with a value, I got the following :
Incorrect Usage: Cannot use two forms of the same flag: etcd-snapshot-retention snapshot-retention
--snapshot-retention value, --etcd-snapshot-retention value (db) Number of snapshots to retain. (default: 5)
This error suggests that you've already got etcd-snapshot-retention
set in your config file. If you have it set in the config file AND on the CLI, but using different forms, the go CLI framework will raise the error you're seeing.
Environmental Info:
Cluster Configuration:
3 servers / 3 Agents
Describe the bug:
"rke2 snapshot command" don't let us to remove snapshots on all nodes. Documentation about pruning snapshot isn't up to date.
Steps To Reproduce:
on 1st node :
ls -l /var/lib/rancher/rke2/server/db/snapshots | wc -l 57
Then :rke2 etcd-snapshot prune --etcd-snapshot-retention 5 --name etcd-snapshot
This runs without issues, but it seems to remove only the snapshot on one node only :
On another etcd node, the snapshot directory is full :
On other nodes, running the previous command does nothing and listing snapshots is showing the snapshop on the first node only
Could you clarify documentation with the "good" command to prune etcd snaphosts on all etcd nodes ?
Expected behavior:
Pruning snaphost on all nodes, or at least running the same command on every nodes should work.
Actual behavior:
Only pruning snaphost on one node.
Additional context / logs:
The documentation here ( https://docs.rke2.io/backup_restore#prune-snapshots ) tells us to run the following command :
rke2 etcd-snapshot prune --snapshot-retention <NUM-OF-SNAPSHOTS-TO-RETAIN>
When running with a value, I got the following :
The documentation is at least not up to date.