Skip to content

Instantly share code, notes, and snippets.

@mwiencek
Created October 23, 2023 16:56
Show Gist options
  • Save mwiencek/c3ae84396425d10aaaf4f3acd5824607 to your computer and use it in GitHub Desktop.
Save mwiencek/c3ae84396425d10aaaf4f3acd5824607 to your computer and use it in GitHub Desktop.
Restarting haproxy-postgres (without downtime)
On jimmy:
cd /root/docker-server-configs
./scripts/set_service_maintenance.sh enable haproxy-postgres 65433
./scripts/set_service_maintenance.sh enable haproxy-postgres 65434
./scripts/set_service_maintenance.sh enable haproxy-postgres 65435
psql -h localhost -p 65436 -U musicbrainz -d pgbouncer -c 'RECONNECT;'
psql -h localhost -p 65437 -U musicbrainz -d pgbouncer -c 'RECONNECT;'
psql -h localhost -p 65438 -U musicbrainz -d pgbouncer -c 'RECONNECT;'
On hendrix:
psql -h localhost -p 65436 -U musicbrainz -d pgbouncer -c 'RECONNECT;'
psql -h localhost -p 65437 -U musicbrainz -d pgbouncer -c 'RECONNECT;'
psql -h localhost -p 65438 -U musicbrainz -d pgbouncer -c 'RECONNECT;'
On jimmy:
docker stop haproxy-postgres && docker rm haproxy-postgres
./scripts/start_services.sh
On hendrix:
cd /root/docker-server-configs
./scripts/set_service_maintenance.sh enable haproxy-postgres 65433
./scripts/set_service_maintenance.sh enable haproxy-postgres 65434
./scripts/set_service_maintenance.sh enable haproxy-postgres 65435
psql -h localhost -p 65436 -U musicbrainz -d pgbouncer -c 'RECONNECT;'
psql -h localhost -p 65437 -U musicbrainz -d pgbouncer -c 'RECONNECT;'
psql -h localhost -p 65438 -U musicbrainz -d pgbouncer -c 'RECONNECT;'
On jimmy:
psql -h localhost -p 65436 -U musicbrainz -d pgbouncer -c 'RECONNECT;'
psql -h localhost -p 65437 -U musicbrainz -d pgbouncer -c 'RECONNECT;'
psql -h localhost -p 65438 -U musicbrainz -d pgbouncer -c 'RECONNECT;'
On hendrix:
docker stop haproxy-postgres && docker rm haproxy-postgres
./scripts/start_services.sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment