-
Notifications
You must be signed in to change notification settings - Fork 210
Postgres Upgrade 13.3
- Vacuum full (recommendation)
- Stop the chef-server
- Take a copy of the
/opt/opscode/embedded/postgresql/*
(need to remove this step) - Download the upgrade build (14.6.33+20210719175317 used for testing)
- Install the package
- Restore
/opt/opscode/embedded/postgresql/*
(need to remove this step) - Upgrade the chef-server
- Start and cleanse the chef-server
- Reindex the database
- Install verison -> 14.5.29
- Upgrade version -> 14.6.33+20210719175317
- PG data -> 158G /var/opt/opscode/postgresql/9.6/data
- Number of nodes -> 565596
- opscode_chef size -> 49 GB
- bifrost -> 68 GB
- oc_id -> 27 GB
- Total time take for vacuum full -> 183m49.091s
- PG data -> 21G /var/opt/opscode/postgresql/9.6/data (reduced from 158G)
- Number of nodes -> 565596
- opscode_chef size -> 21 GB (reduced from 49 GB)
- bifrost -> 7127 kB (reduced from 68 GB)
- oc_id -> 30 MB (reduced from 27 GB)
- Total time take for upgrade process -> approx 15 min
- PG data -> 21G /var/opt/opscode/postgresql/13.3/data (same as before)
- Number of nodes -> 565596
- opscode_chef size -> 21 GB (same as before)
- bifrost -> 8949 kB (increased from 7127 kB)
- oc_id -> 32 MB (increased from 30 MB)
su opscode-pgsql
bash
cd /opt/opscode/embedded/postgresql/13.3/bin
time ./psql -U opscode-pgsql -d opscode_chef -c 'REINDEX DATABASE opscode_chef'
real 3m11.138s
user 0m0.003s
sys 0m0.000s
time ./psql -U opscode-pgsql -d bifrost -c 'REINDEX DATABASE bifrost'
real 0m1.138s
user 0m0.003s
sys 0m0.000s
time ./psql -U opscode-pgsql -d oc_id -c 'REINDEX DATABASE oc_id'
real 0m1.147s
user 0m0.003s
sys 0m0.000s
du -hs /var/opt/opscode/postgresql/13.3/data
21G /var/opt/opscode/postgresql/13.3/data/
chef-server-ctl psql oc_erchef <<<"select count(*) from nodes; \q"
565596
chef-server-ctl psql oc_erchef <<<"SELECT pg_size_pretty( pg_database_size('opscode_chef') ); \q"
20 GB
chef-server-ctl psql bifrost <<<"SELECT pg_size_pretty( pg_database_size('bifrost') ); \q"
8773 kB
chef-server-ctl psql oc_id <<<"SELECT pg_size_pretty( pg_database_size('oc_id') ); \q"
32 MB