CentOS7 PostgreSQL Master-slave configuration

Source: Internet
Author: User
Tags postgresql

PostgreSQL installation

Installation
Install with Yum (source http://yum.postgresql.org/)

Yum Install https://download.postgresql.org/pub/repos/yum/9.5/redhat/rhel-7-x86_64/pgdg-centos95-9.5-2.noarch.rpm
Yum Install Postgresql95-server Postgresql95-contrib


Set Boot boot (CentOS service installation location Cd/usr/lib/systemd/system/*.service)
Systemctl Enable Postgresql-9.5.service


Start the service
Systemctl Start Postgresql-9.5.service
Systemctl Status Resql-9.5.service


Initializing the database
/usr/pgsql-9.5/bin/postgresql95-setup Initdb


Turn on remote access
/var/lib/pgsql/9.5/data/postgresql.conf

listen_addresses = ' * '
/var/lib/pgsql/9.5/data/pg_hba.conf

# IPV4 Local connections:
Host All 127.0.0.1/32 Trust
Host All 192.168.117.1/32 Trust
# IPV6 Local connections:
Host all:: 1/128 Trust


Modify User Password

Su Postgres
Psql-u Postgres
ALTER USER postgres with PASSWORD ' Postgres '
\q

CentOS7 PostgreSQL Master-slave configuration

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.