Charmed PostgreSQL VM
- By Canonical Data Platform
- Databases
Channel | Revision | Published | Runs on |
---|---|---|---|
latest/stable | 345 | 09 Nov 2023 | |
14/stable | 363 | 21 Feb 2024 | |
14/candidate | 363 | 31 Jan 2024 | |
14/beta | 368 | 21 Feb 2024 | |
14/edge | 396 | 16 Apr 2024 |
juju deploy postgresql --channel 14/stable
Deploy universal operators easily with Juju, the Universal Operator Lifecycle Manager.
Platform:
How to create and list backups
This guide contains recommended steps and useful commands for creating and managing backups to ensure smooth restores:
- Save your current cluster credentials, as you’ll need them for restoring
- Create backups
- List backups to check the availability and status of your backups
Note: All commands are written for juju >= v.3.0
If you are using an earlier version, be aware that:
juju run
replacesjuju run-action --wait
injuju v.2.9
juju integrate
replacesjuju relate
andjuju add-relation
injuju v.2.9
For more information, check the Juju 3.0 Release Notes.
Prerequisites
- A cluster with at least three nodes deployed
- Access to S3 storage
- Configured settings for S3 storage
Save your current cluster credentials
For security reasons, charm credentials are not stored inside backups. So, if you plan to restore to a backup at any point in the future, you will need theoperator
, replication
, and rewind
user passwords for your existing cluster.
You can retrieve them with:
juju run postgresql/leader get-password username=operator
juju run postgresql/leader get-password username=replication
juju run postgresql/leader get-password username=rewind
For more context about passwords during a restore, check How to restore a (foreign) backup | Manage cluster passwords.
Create backups
Once you have a three-node cluster with configurations set for S3 storage, check that Charmed PostgreSQL isactive
and idle
with juju status
.
Once Charmed PostgreSQL is active
and idle
, you can create your first backup with the create-backup
command:
juju run postgresql/leader create-backup
Tip: To avoid unnecessary service downtime, always use non-primary units for the action create-backup
. Keep in mind that:
- TLS enabled: disables the command from running on primary units.
- TLS not enabled: disables the command from running on non-primary units.
List backups
You can list your available, failed, and in progress backups by running thelist-backups
command:
juju run postgresql/leader list-backups