This shows you the differences between two versions of the page.
puppet_upgrade_4.x_to_5.x [2018/04/18 22:22] k2patel [Upgrade Postgresql data] |
puppet_upgrade_4.x_to_5.x [2020/08/10 02:35] |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== Puppet Upgrade 4.x to 5.x ====== | ||
- | This is simple steps to upgrade puppet. | ||
- | ==== Stop service ==== | ||
- | <code bash> | ||
- | systemctl stop puppetserver | ||
- | systemctl stop puppetdb | ||
- | </code> | ||
- | |||
- | ==== Update Puppet server ==== | ||
- | Download New repo [[http://yum.puppetlabs.com/puppet/el/7/x86_64/puppet-release-1.0.0-1.el7.noarch.rpm|puppet-release]] | ||
- | |||
- | <code bash> | ||
- | yum install puppetserver | ||
- | </code> | ||
- | |||
- | ==== Postgresql upgrade ==== | ||
- | |||
- | Install New postgres [[https://download.postgresql.org/pub/repos/yum/9.6/redhat/rhel-7Workstation-x86_64/pgdg-redhat96-9.6-3.noarch.rpm|pgdg-redhat9.6]] | ||
- | |||
- | <code bash> | ||
- | systemctl stop postgresql-9.5 | ||
- | yum install postgresql96-server | ||
- | yum install postgresql96-contrib | ||
- | </code> | ||
- | |||
- | ==== Upgrade Postgresql data ==== | ||
- | |||
- | :!: Do it as user `postgres` | ||
- | |||
- | <code bash> | ||
- | /usr/pgsql-9.6/bin/initdb /var/lib/pgsql/9.6/data/ | ||
- | /usr/pgsql-9.6/bin/pg_upgrade -b /usr/pgsql-9.5/bin/ -B /usr/pgsql-9.6/bin/ -d /var/lib/pgsql/9.5/data/ -D /var/lib/pgsql/9.6/data/ -v | ||
- | |||
- | systemctl start postgresql-9.6 | ||
- | </code> | ||
- | |||
- | ==== Upgrading puppetdb ==== | ||
- | Upgrade puppetdb | ||
- | <code bash> | ||
- | yum install puppetdb | ||
- | yum install puppetdb-termini | ||
- | |||
- | puppet resource service puppetdb ensure=stopped | ||
- | puppet resource package puppetdb ensure=latest | ||
- | puppet resource service puppetdb ensure=running | ||
- | </code> | ||
- | |||
- | |||
- | ==== Final steps after your puppet started working ==== | ||
- | Optimize postgresql puppetdb.\\ | ||
- | :!: run as `postgres` user. | ||
- | |||
- | <code bash> | ||
- | ./analyze_new_cluster.sh | ||
- | ./delete_old_cluster.sh | ||
- | </code> | ||
- | |||
- | |||
- | ==== If it doesn't works as expected with puppetdb ==== | ||
- | :!: Run as `postgres` user | ||
- | |||
- | :?: Only if you do not care for the data | ||
- | |||
- | <code psql> | ||
- | drop database 'puppetdb' | ||
- | </code> | ||
- | |||
- | <code bash> | ||
- | createdb -E UTF8 -O puppetdb puppetdb | ||
- | psql puppetdb -c 'create extension pg_trgm' | ||
- | </code> |