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