Valkey: Persistence & LXC Backups #9661
pshankinclarke
started this conversation in
Guides
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Valkey persistence and Proxmox backups
This guide walks through setting up persistence in the Valkey LXC and how it works with Proxmox backups and restores.
Persistence in Valkey refers to retaining data across restarts by writing it to disk. Proxmox provides backup and restore for LXC containers, so once Valkey is persisting to disk, Proxmox can back it up and restore it as needed.
Valkey includes RDB defaults:
3600 1 300 100 60 10000, but depending on your use case, you might want to change this. Below are some common persistence profiles and an example of how they behave with Proxmox backups.Persistence profiles
All example snippets can be placed in
/etc/valkey/valkey.confand then restart the service:RDB (default persistence)
This uses point-in-time snapshots (
dump.rdb) to persist data. On a fresh Debian-based Valkey LXC, RDB is enabled with the following defaults ( retrievable viavalkey-cli CONFIG GET save):AOF (Append Only File) persistence
Debian does not enable AOF by default. Once enabled, AOF logs each write operation by the server. On restart, Valkey replays the log to rebuild your dataset.
No persistence
This disables persistence completely so the instance behaves like a cache. All data is lost on restart.
RDB + AOF hybrid
If you want durability similar to what PostgreSQL offers, turn on RDB snapshots and AOF.
Proxmox backup integration steps
1. Edit
/etc/valkey/valkey.confinside the container and set one of the profiles, then restart.You should see files like this, depending on the profile:
2. Write some data to Valkey:
3. On the host, run a backup of the container:
This creates an archive at a templatized path:
4. Restore into a new container:
5. Verify the data:
If you get
barand42, then your persistence and backup are successfully capturing and restoring your Valkey dataset!Beta Was this translation helpful? Give feedback.
All reactions