Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Centos6 installs postgresql9 master-slave node key feeds

2025-04-05 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

1. Demand analysis

System version:

Cat / etc/redhat-release

Red Hat Enterprise Linux Server release 6.7 (Santiago)

The master-slave function is available only after PGSQL9, but PGSQL8 is installed by default in the source of centos6, so you need to download the package and install it online.

2. Uninstall the old version of PGSQL

# yum remove postgresql-server

3. Find the version you need on the following website

Https://download.postgresql.org/pub/repos/yum/9.4/redhat/rhel-6.7-x86_64/

Postgresql94-9.4.18-1PGDG.rhel6.x86_64.rpm

Postgresql94-devel-9.4.18-1PGDG.rhel6.x86_64.rpm

Postgresql94-libs-9.4.18-1PGDG.rhel6.x86_64.rpm

Postgresql94-server-9.4.18-1PGDG.rhel6.x86_64.rpm

4. Upload and install

# yum install-y postgresql94-libs-9.4.18-1PGDG.rhel6.x86_64.rpm postgresql94- 9.4.18-1PGDG.rhel6.x86_64.rpm postgresql94-server-9.4.18-1PGDG.rhel6.x86_64.rpm postgresql94-devel-9.4.18-1PGDG.rhel6.x86_64.rpm

5. Pay attention to the execution of commands

Because it is not installed by system default, you need to add the execution path to the environment variable

View the specific location of the relevant commands through the command

# rpm-qa | grep postgres*

Postgresql94-libs-9.4.18-1PGDG.rhel6.x86_64

Postgresql94-devel-9.4.18-1PGDG.rhel6.x86_64

Postgresql-libs-8.4.20-8.el6_9.x86_64

Postgresql94-9.4.18-1PGDG.rhel6.x86_64

Postgresql94-server-9.4.18-1PGDG.rhel6.x86_64

# rpm-ql postgresql94-server-9.4.18-1PGDG.rhel6.x86_64 | more

/ usr/pgsql-9.4/bin/psql

/ usr/pgsql-9.4/bin/initdb

/ usr/pgsql-9.4/bin/pg_ctl

# vi / etc/profile

Add

Export PATH=$PATH://usr/pgsql-9.4/bin

# source / etc/profile

6. Boot mode and boot configuration

Startup mode

$pg_ctl-D / data/pg_data start

Boot service configuration

Vi / etc/rc.d/rc.local

Add

/ usr/pgsql-9.4/bin/pg_ctl-D / data/pg_data start

If the service doesn't work, you can check the log file / data/pg_data/pg_log/postgresql-xxx.log for troubleshooting.

Other configurations are no different from the production environment postgresql master-slave environment configuration in my previous article.

Reference:

Https://blog.csdn.net/kongxx/article/details/52883383

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report