diff --git a/howto/postgresql.md b/howto/postgresql.md index c7542955508d28d752f043111da07ff73fe19c84..96d4c7387d164d3e009a0bd51c7f14ee38d1ba2c 100644 --- a/howto/postgresql.md +++ b/howto/postgresql.md @@ -2146,16 +2146,48 @@ This will eventually become the default, but for now that needs to be added by hand, either in `hiera/roles/$ROLE.yaml` or `hiera/nodes/$FQDN.yaml` if the node does not have a role. +The configuration of the new backup can be tested with this command on +the client: + + sudo -u postgres pgbackrest --stanza=`hostname -f` check + +For example, this was done to test `weather-01`: + + root@weather-01:~# sudo -u postgres pgbackrest --stanza=weather-01.torproject.org check + Then Puppet needs to run on the "client" (the PostgreSQL server) and on the "repository" (the backup server, currently `backup-storage-01`). The full backups will run in the coming week, -but can be ran manually with: +but can be ran manually on the repository server with: systemctl start pgbackrest-backup-full@$HOSTNAME.service For example: - systemctl start pgbackrest-backup-full@materculae.service + root@backup-storage-01:~# systemctl start pgbackrest-backup-full@materculae.service + +You should be able to see information about that backup with the +`info` command on the client: + + sudo -u postgres pgbackrest --stanza=`hostname -f` info + +For example: + +``` +root@weather-01:~# sudo -u postgres pgbackrest --stanza=`hostname -f` info +stanza: weather-01.torproject.org + status: ok + cipher: none + + db (current) + wal archive min/max (15): 000000010000001F00000004/00000001000000210000002F + + full backup: 20241118-202245F + timestamp start/stop: 2024-11-18 20:22:45 / 2024-11-18 20:28:43 + wal start/stop: 000000010000001F00000009 / 000000010000001F00000009 + database size: 40.3MB, database backup size: 40.3MB + repo1: backup set size: 7.6MB, backup size: 7.6MB +``` Finally, the old backup directory needs to be moved out to avoid warnings on the old storage server (currently `bungei`): @@ -2170,15 +2202,6 @@ The old backups should be scheduled for removal with: echo rm -r /srv/backups/pg/$HOSTNAME.old | at now + 30 days -The configuration of the new backup can be tested with this command on -the client: - - sudo -u postgres pgbackrest --stanza=$FQDN check - -For example, this was done to test `weather-01`: - - root@weather-01:~# sudo -u postgres pgbackrest --stanza=weather-01.torproject.org check - ### Manual configuration Those instructions are kept for historical reference, and are all