You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+29-4Lines changed: 29 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,7 +3,7 @@
3
3
This project, nicknamed "Laterbase", sets up a Docker-based environment specifically designed for **DaVinci Resolve PostgreSQL databases**. It consists of:
4
4
5
5
1.**PostgreSQL Standby Server:** Creates a hot standby replica of your primary DaVinci Resolve PostgreSQL database using streaming replication.
6
-
2.**Hourly Backup Agent:** Performs hourly logical backups (`pg_dump`) of your primary DaVinci Resolve database.
6
+
2.**Hourly Backup Agent:** Performs hourly logical backups (`pg_dump`) of your primary DaVinci Resolve database, optionally uploads them to cloud storage using `rclone`, and manages local backup retention.
7
7
3.**pgAdmin 4 UI:** Provides a web-based graphical interface for managing and monitoring both the primary DaVinci Resolve database and the standby replica.
**Note on Physical Replication Slot:** A physical replication slot (`laterbase_standby_slot` in this setup) is a feature on the primary PostgreSQL server. It ensures that the primary server retains the necessary transaction logs (WAL segments) required by the standby server, even if the standby disconnects temporarily. This prevents the standby from falling too far behind and needing a full resynchronization.
@@ -56,6 +65,11 @@ graph TD
56
65
* Replace `YOUR_PGADMIN_PASSWORD_HERE` with the password you want for the pgAdmin login.
57
66
* Adjust `PRIMARY_PORT` or `PRIMARY_USER` if they differ from the defaults (5432, postgres).
58
67
* Optionally, uncomment and set `POSTGRES_USER`, `POSTGRES_DB`, or `PGDATA` under the "Standby Server Configuration" section to override the defaults used by the standby service.
68
+
***Rclone Upload (Optional):**
69
+
* Set `RCLONE_REMOTE_NAME` to the name of the remote you have configured in your `rclone.conf` file (e.g., `mygdrive`, `s3remote`). Leave blank to disable uploads.
70
+
* Set `RCLONE_REMOTE_PATH` to the directory path within your rclone remote where backups should be stored (e.g., `resolve_backups/production`). Leave blank to disable uploads.
71
+
***Backup Retention (Optional):**
72
+
* Set `BACKUP_RETENTION_DAYS` to the number of days you want to keep local backups in the `./backups` directory. Defaults to 7 if not set.
59
73
60
74
2.**Primary PostgreSQL Server Preparation (`PRIMARY_HOST`):**
61
75
* Ensure the target database is marked as shared or accessible on the resolve box
@@ -77,6 +91,16 @@ graph TD
77
91
mkdir backups
78
92
```
79
93
94
+
4. **Rclone Configuration (Optional):**
95
+
* If you want to use the cloud upload feature:
96
+
* Create a directory named `rclone_config`in the same directory as`docker-compose.yml`:
97
+
```bash
98
+
mkdir rclone_config
99
+
```
100
+
* Place your configured `rclone.conf` file inside the `./rclone_config/` directory. The backup container will mount this directory read-only at `/config/rclone.conf`.
101
+
* Ensure the remote name you use in`rclone.conf` matches the `RCLONE_REMOTE_NAME`setin your `.env` file.
102
+
***Security Note:** The `rclone.conf` file contains sensitive credentials. Ensure appropriate file permissions are seton the host machine (`chmod 600 ./rclone_config/rclone.conf`).
103
+
80
104
## Usage
81
105
82
106
1. **Build and Start Containers:**
@@ -109,5 +133,6 @@ graph TD
109
133
* `setup_standby.sh`: Script run inside the standby container on first start to perform the initial base backup and configure replication.
110
134
* `backup.sh`: Script run by cron inside the backup agent container to perform hourly `pg_dump` backups.
111
135
* `crontab.txt`: Defines the cron schedule for `backup.sh`.
112
-
* `./backups/` (Directory to be created): Host directory where backup files (`.sql.gz`) will be stored by the backup agent.
136
+
* `./backups/` (Directory to be created): Host directory where local backup files (`.sql.gz`) will be stored by the backup agent.
137
+
* `./rclone_config/` (Directory to be created, optional): Host directory containing the `rclone.conf` file for cloud uploads.
0 commit comments