-
-
Save npwalker/193b7ee5b046df207726e53144e0b765 to your computer and use it in GitHub Desktop.
Installing pg_repack in Puppet Enterprise
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
yum install pe-postgresql-devel zlib-devel readline-devel gcc -y | |
PATH=$PATH:/opt/puppetlabs/server/bin/ | |
cd /tmp | |
git clone https://github.com/reorg/pg_repack | |
cd pg_repack | |
git checkout ver_1.4.1 | |
make | |
make install | |
su - pe-postgres -s /bin/bash -c "psql -d pe-puppetdb -c 'CREATE EXTENSION pg_repack'" | |
su - pe-postgres -s /bin/bash -c "psql -d pe-classifier -c 'CREATE EXTENSION pg_repack'" | |
su - pe-postgres -s /bin/bash -c "psql -d pe-rbac -c 'CREATE EXTENSION pg_repack'" | |
su - pe-postgres -s /bin/bash -c "psql -d pe-activity -c 'CREATE EXTENSION pg_repack'" | |
su - pe-postgres -s /bin/bash -c "psql -d pe-orchestrator -c 'CREATE EXTENSION pg_repack'" | |
su - pe-postgres -s /bin/bash -c "psql -d pe-postgres -c 'CREATE EXTENSION pg_repack'" | |
su - pe-postgres -s /bin/bash -c "/opt/puppetlabs/server/apps/postgresql/bin/pg_repack --help" | |
#--all doesn't work because the postgres database seems to be hard coded | |
[root@master201642-centos pg_repack]# su - pe-postgres -s /bin/bash -c "/opt/puppetlabs/server/apps/postgresql/bin/pg_repack --all" | |
ERROR: could not connect to database with "dbname=postgres ": FATAL: database "postgres" does not exist | |
#use a specific db name instead | |
[root@master201642-centos pg_repack]# su - pe-postgres -s /bin/bash -c "/opt/puppetlabs/server/apps/postgresql/bin/pg_repack -d pe-puppetdb" | |
INFO: repacking table "environments" | |
INFO: repacking table "fact_paths" | |
INFO: repacking table "facts" | |
INFO: repacking table "report_statuses" | |
INFO: repacking table "schema_migrations" | |
INFO: repacking table "value_types" | |
INFO: repacking table "factsets" | |
INFO: repacking table "resource_params" | |
INFO: repacking table "edges" | |
INFO: repacking table "catalogs" | |
INFO: repacking table "reports" | |
INFO: repacking table "certnames" | |
INFO: repacking table "catalog_resources" | |
INFO: repacking table "producers" | |
INFO: repacking table "fact_values" | |
INFO: repacking table "resource_params_cache" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
pg_repack links:
https://gitlab.com/gitlab-com/infrastructure/issues/337
https://about.gitlab.com/2016/11/10/why-choose-bare-metal/
http://kupershmidt.org/pg/10_Things_I_Hate_About_PostgreSQL/#/10