Centralize the postgresql databases used for admin tools into a single dedicated host
(on which we would be able to do more proper backups and monitoring).
This is also the occasion to use the latest postgresql versions (each have their own and
inconsistent versions).
Impacted services:
- hedgedoc (host: bardo, db: postgres-12)
- netbox (host: bojimans, db: postgres-11)
- grafana (host: pergamon, db: postgres-11)
- sentry (host: riverside, db: postgres-12)
- keycloak (host: kelvingrove, db: postgres-12)
This is the size of the current databases:
Database | Size |
---|---|
hedgedoc | 42MB |
netbox | 22MB |
grafana | 18MB |
sentry | 99GB |
keycloak | 15MB |
The sentry database will force us to reserve a large amount of disk for the new server
Plan:
- Leave services' configuration untouched to use local db
- T3833#76853: Create zfs data mount point (for the dbs' data)
- D6928: Declare a dedicated puppet profile, this lists all required dbs to create (using profile::postgresql::server).
- D6906: terraform (/vagrant) to boostrap (this applies puppet so the dbs get created)
- T3833#76889: firewall: Open flux from vlan 440 (bojimans, kelvingrove, riverside, #pergamon) to vlan 442, port 5432
- for each service in {D6946: netbox, D6947: hedgedoc, T3817: grafana, D6951: sentry, rSPSITE2b8a33e79d6e49554339e3b70134eb84e8cad7cf: keycloak}:
- Stop the service (we don't have incremental dump so stop the service first)
- Export and mount back data dump from old db to the new one
- Adapt configuration to switch to the new db
- puppet apply to restart service (which now uses the new db)
- Ensure service is still ok
Annex actions (outside the scope of this task, like T3817):
- T3850: Move services {netbox, sentry, keycloak} in the admin vlan (442) and behind the reverse proxy
- T3849: Clean up leftovers after migration
Related to D6871#178665