Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Wiki Replica
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
The Tor Project
TPA
Wiki Replica
Commits
bb624bb3
Verified
Commit
bb624bb3
authored
3 months ago
by
anarcat
Browse files
Options
Downloads
Patches
Plain Diff
reflect changes in pgbackrest policies
parent
324e3295
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Pipeline
#232803
passed with warnings
3 months ago
Stage: build
Stage: test
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
howto/postgresql.md
+42
-2
42 additions, 2 deletions
howto/postgresql.md
with
42 additions
and
2 deletions
howto/postgresql.md
+
42
−
2
View file @
bb624bb3
...
...
@@ -2242,8 +2242,8 @@ The new backup system is based on [pgBackRest][]. It works by SSH'ing
between the client and server and running
`pgbackrest`
commands, which
encapsulates all functionality including backup, and restore.
Backups are retained for
3 weeks (21
days), although the source of
truth for
this is not here but in Hiera, in
`tor-puppet.git`
's
Backups are retained for
(30
days), although the source of
truth for
this is not here but in Hiera, in
`tor-puppet.git`
's
`hiera/common/postgresql.yaml`
, the
`pgbackrest::config:global:repo1-retention-full`
value. Expiration is
performed when backups are ran, from the systemd timers. See also the
...
...
@@ -2251,6 +2251,46 @@ performed when backups are ran, from the systemd timers. See also the
[
pgBackRest
]:
https://pgbackrest.org/
pgBackRest considers
[
3 different backup types
](
https://pgbackrest.org/command.html#command-backup/category-command/option-type
)
, here are schedules
for those:
| type | frequency | note |
|--------|-----------|--------------------------------------------------------------------------------------------------|
|
`full`
| 30 days | all database cluster files will be copied and there will be no dependencies on previous backups. |
|
`diff`
| 7 days | like an incremental backup but always based on the last full backup. |
|
`incr`
| 24h | incremental from the last successful backup. |
Backups are scheduled using systemd timers exported from each node,
based on a template per backup type, so there's a matrix of
`pgbackrest-backup-{diff,full}@.{service,timer}`
files on the
repository server, e.g.
```
root@backup-storage-01:~# ls /etc/systemd/system | grep @\\.
pgbackrest-backup-diff@.service
pgbackrest-backup-diff@.timer
pgbackrest-backup-full@.service
pgbackrest-backup-full@.timer
pgbackrest-backup-incr@.service
pgbackrest-backup-incr@.timer
```
Each server has its own instance of that, a symlink to those, for
example weather-01:
```
root@backup-storage-01:~# ls -l /etc/systemd/system | grep weather-01
lrwxrwxrwx 1 root root 31 Dec 5 02:02 pgbackrest-backup-diff@weather-01.service -> pgbackrest-backup-diff@.service
lrwxrwxrwx 1 root root 49 Dec 4 21:51 pgbackrest-backup-diff@weather-01.timer -> /etc/systemd/system/pgbackrest-backup-diff@.timer
lrwxrwxrwx 1 root root 31 Dec 5 02:02 pgbackrest-backup-full@weather-01.service -> pgbackrest-backup-full@.service
lrwxrwxrwx 1 root root 49 Dec 4 21:51 pgbackrest-backup-full@weather-01.timer -> /etc/systemd/system/pgbackrest-backup-full@.timer
lrwxrwxrwx 1 root root 31 Dec 16 18:32 pgbackrest-backup-incr@weather-01.service -> pgbackrest-backup-incr@.service
lrwxrwxrwx 1 root root 49 Dec 16 18:32 pgbackrest-backup-incr@weather-01.timer -> /etc/systemd/system/pgbackrest-backup-incr@.timer
```
Retention is configured at the "full" level, with the
`repo1-retention-full`
setting.
### Puppet setup
PostgreSQL servers are automatically configured to use pgBackRest to
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment