[c-lightning] Add secondary persistence for sqlite3 replication #104
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes #103
This PR adds a secondary persistent storage option that mounts to /root/backup. The intended purpose is to use built-in CLN db replication by adding configuration like:
This way the main
lightningd.sqlite3
db will be handled bypersistence:
and the replica will be handled bypersistenceBackup:
.In my setup, I'm using local-path-provisioner for the main pvc and an nfs-external-provisioner for the backup storage. This way the db is replicated to an NFS share and periodically backed up. It's still not ideal because the replica on NFS is getting hot-backed-up, but in this scenario 3 different things will all have to fail:
The odds of all 3 failing is not likely, but this will suffice until a more elegant backup strategy can be implemented in the future. Maybe some kind of sidecar running
sqlite3 .backup
on a cron or something.