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

[c-lightning] Add secondary persistence for sqlite3 replication #104

Merged
merged 1 commit into from
May 9, 2024

Conversation

bboerst
Copy link
Owner

@bboerst bboerst commented May 9, 2024

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:

wallet=sqlite3:///root/.lightning/bitcoin/lightningd.sqlite3:/root/backup/lightningd.sqlite3

This way the main lightningd.sqlite3 db will be handled by persistence: and the replica will be handled by persistenceBackup:.

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:

  1. Main db failure
  2. Replica failure
  3. Nightly backup failure

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.

@bboerst bboerst force-pushed the c-lightning-sqlite3-backup-work branch from 8ff4632 to bfa4513 Compare May 9, 2024 00:57
@bboerst bboerst merged commit d3a6cce into master May 9, 2024
4 checks passed
@bboerst bboerst deleted the c-lightning-sqlite3-backup-work branch May 9, 2024 00:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[c-lightnig] Implement basic backup mechanism
1 participant