S 9.2.4 Upgrade Plan and steps

Source: Internet
Author: User

The Community recently launched ipvs 9.2.4, which aims to install a security patch and requires an upgrade. The upgrade procedure documentation is also detailed (Part 17 ), generally, there are two methods: pg_upgrade and dump/restore. For 9.2.0 and later versions, you can directly compile and install them. For versions earlier than 9.2.0, you also need the dump/restore method, which involves downtime, do a good job in business communication. In this upgrade, the version with a large data volume is 9.2.0, and the data volume of other small versions is relatively small, so the latter method is used for the upgrade.

Steps:

1. Backup
Pg_dump-h 192.168.2.150-p 5432-U postgres-B-Fp db_www.bkjia.com-f db. bak
For security, check whether the backed up files are normal and whether the files can be imported correctly. Remember the user name and password.

2. Close the service
Pg_stop
Ps-ef | grep postgres check

3. Compile postgresql_9.2.4, which was originally 9.1.3
Postgres@www.bkjia.com ~ $ Tar-zxvf postgresql_9.2.4.tar.gz
Postgres@www.bkjia.com ~ Cd postgresql_9.2.4
[Postgres@www.bkjia.com postgresql_9.2.4]. /configure -- prefix =/home/postgres -- with-pgport = 5432 -- with-segsize = 8 -- with-wal-segsize = 64 -- with-wal-blocksize = 64 --- perl -- with-python -- with-openssl -- with-pam -- with-ldap -- with-libxml -- with-libxslt -- enable-thread-safety
[Postgres@www.bkjia.com postgresql_9.2.4] gmake world
[Postgres@www.bkjia.com postgresql_9.2.4] gmake install-world
If yes, check whether the BIN has been replaced by 9.2.4.
[Postgres@www.bkjia.com postgresql_9.2.4] $ psql-V
Psql (PostgreSQL) 9.2.4
[Postgres@www.bkjia.com postgresql_9.2.4] $
The binfile is OK.
If the original version is 9.2.0 or later, skip the following steps to start ipvs directly. If the original version is earlier than 9.2.0, an error will be reported when it is started directly. This is similar to the inconsistency between initdb and configure versions.

4. modify data files
Postgres@www.bkjia.com ~ Mv/database/pgdata. old
Postgres@www.bkjia.com ~ Mkdir/database/pgdata

5. initialize the database
Postgres@www.bkjia.com ~ $ Initdb-D/database/pgdata-E UTF8 -- locale = C-U postgres-W

6. Copy the old postgresql. conf and pg_cmd.conf files to the new $ PGDATA file.
Postgres@www.bkjia.com ~ $ Cp/database/pgdata. old/postgresql. conf/database/pgdata/postgresql. conf
Postgres@www.bkjia.com ~ $ Cp/database/pgdata. old/hba. conf/database/pgdata/hba. conf

7. Start the database
Pg_start
-- If the database is exported and restored from a single database, create a database and related users, saving the trouble of importing an error.

8. Restore data
Postgres@www.bkjia.com ~ $ Psql-d db_www.bkjia.com-f db. bak

9. Check
Check whether there are exceptions in data, applications, and logs, and some easily missed parameters such as timezone. You can select now () in the database () check whether it matches the system time to check whether there is another pg_upgrade method that does not require data dump export.

That's it.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.