Skip to content
Tom Hughes edited this page Feb 27, 2022 · 13 revisions
  • Take site offline
  • Stop chef on all database servers
  • Stop postgres on master
  • Stop postgres on slaves
  • Ugrade master
    • sudo pg_upgradecluster -v <new-version> -m upgrade -k <old-version> main
  • Update cookbooks/db/attributes/default.rb in chef to new version
  • Run chef on master, wait for run to complete and check postgres is up and working
  • Stop chef on master
  • Stop postgres on master
  • Sync tablespaces to slaves
    • cd /var/lib/postgresql
    • sudo rsync --verbose --archive --delete --hard-links --size-only --no-inc-recursive --no-inc-recursive --copy-dirlinks --keep-dirlinks <old-version> <new-version> root@slave:/var/lib/postgresql
    • cd /store/postgresql
    • sudo rsync --verbose --archive --delete --hard-links --size-only --no-inc-recursive --no-inc-recursive --copy-dirlinks --keep-dirlinks openstreetmap root@slave:/store/postgresql
    • sudo rsync --verbose --archive --delete --hard-links --size-only --no-inc-recursive --no-inc-recursive --copy-dirlinks --keep-dirlinks ssd root@slave:/store/postgresql
  • Start postgres on master and check postgres is up and working
  • Run chef on slaves, wait for run to complete and check postgres is up and working
  • Drop old cluster sudo pg_dropcluster <old-version> main on each machine
  • Bring site online
Clone this wiki locally