... | ... | @@ -184,10 +184,90 @@ section below as well. |
|
|
|
|
|
# Service-specific upgrade procedures
|
|
|
|
|
|
## RT and PostgreSQL upgrades
|
|
|
## PostgreSQL upgrades
|
|
|
|
|
|
Both of those required special handling in [buster](howto/buster), probably going
|
|
|
to be similar here.
|
|
|
PostgreSQL is special and needs to be upgraded manually.
|
|
|
|
|
|
1. make a full backup of the old cluster:
|
|
|
|
|
|
ssh -tt bungei.torproject.org 'sudo -u torbackup postgres-make-one-base-backup $(grep ^meronense.torproject.org $(which postgres-make-base-backups ))'
|
|
|
|
|
|
The above assumes the host to backup is `meronense` and the backup
|
|
|
server is `bungei`. See [howto/postgresql](howto/postgresql) for details of that
|
|
|
procedure.
|
|
|
|
|
|
2. Once the backup completes, move the directory out of the way and
|
|
|
recreate it:
|
|
|
|
|
|
ssh bungei.torproject.org "mv /srv/backups/pg/meronense /srv/backups/pg/meronense-11 && sudo -u torbackup mkdir /srv/backups/pg/meronense"
|
|
|
|
|
|
3. do the actual cluster upgrade, on the database server:
|
|
|
|
|
|
export LC_ALL=C.UTF-8 &&
|
|
|
printf "about to drop cluster main on postgresql-13, press enter to continue" &&
|
|
|
read _ &&
|
|
|
pg_dropcluster --stop 13 main &&
|
|
|
pg_upgradecluster -m upgrade -k 11 main &&
|
|
|
for cluster in `ls /etc/postgresql/11/`; do
|
|
|
mv /etc/postgresql/11/$cluster/conf.d/* /etc/postgresql/13/$cluster/conf.d/
|
|
|
done
|
|
|
|
|
|
4. make sure the new cluster isn't backed up by bacula:
|
|
|
|
|
|
touch /var/lib/postgresql/13/.nobackup
|
|
|
|
|
|
TODO: put in Puppet.
|
|
|
|
|
|
4. change the cluster target in the backup system, in `tor-puppet`,
|
|
|
for example:
|
|
|
|
|
|
--- a/modules/postgres/manifests/backup_source.pp
|
|
|
+++ b/modules/postgres/manifests/backup_source.pp
|
|
|
@@ -30,7 +30,7 @@ class postgres::backup_source {
|
|
|
# this block is to allow different cluster versions to be backed up,
|
|
|
# or to turn off backups on some hosts
|
|
|
case $::hostname {
|
|
|
- 'materculae': {
|
|
|
+ 'materculae', 'bacula-director-01': {
|
|
|
postgres::backup_cluster { $::hostname:
|
|
|
pg_version => '13',
|
|
|
}
|
|
|
|
|
|
5. change the postgres version in `tor-nagios` as well:
|
|
|
|
|
|
--- a/config/nagios-master.cfg
|
|
|
+++ b/config/nagios-master.cfg
|
|
|
@@ -387,7 +387,7 @@ servers:
|
|
|
materculae:
|
|
|
address: 49.12.57.146
|
|
|
parents: gnt-fsn
|
|
|
- hostgroups: computers, syslog-ng-hosts, apache2-hosts, apache-https-host, hassrvfs, postgres11-hosts
|
|
|
+ hostgroups: computers, syslog-ng-hosts, apache2-hosts, apache-https-host, hassrvfs, postgres13-hosts
|
|
|
|
|
|
|
|
|
# bacula storage
|
|
|
|
|
|
6. once everything works okay, remove the old packages:
|
|
|
|
|
|
apt purge postgresql-11 postgresql-client-11
|
|
|
|
|
|
7. purge the old backups directory after a week:
|
|
|
|
|
|
ssh bungei.torproject.org "echo 'rm -r /srv/backups/pg/meronense-11/' | at now + 7day"
|
|
|
|
|
|
8. make a new full backup of the new cluster:
|
|
|
|
|
|
ssh -tt bungei.torproject.org 'sudo -u torbackup postgres-make-one-base-backup $(grep ^meronense.torproject.org $(which postgres-make-base-backups ))'
|
|
|
|
|
|
It is also wise to read the [release notes](https://www.postgresql.org/docs/release/) for the relevant
|
|
|
release to see if there are any specific changes that are needed at
|
|
|
the application level, for service owners. In general, the above
|
|
|
procedure *does* use `pg_upgrade` so that's already covered.
|
|
|
|
|
|
## RT upgrades
|
|
|
|
|
|
RT also requires special handling in [buster](howto/upgrades/buster),
|
|
|
probably going to be similar here.
|
|
|
|
|
|
## Ganeti upgrades
|
|
|
|
... | ... | |