CentOS7 PostgreSQL installation, configuration, use of detailed _docker

Source: Internet
Author: User
Tags postgresql

CentOS7 PostgreSQL Installation

Install

Installation

Using Yum Installation

Yum Install http://yum.postgresql.org/9.4/redhat/rhel-6-x86_64/pgdg-redhat94-9.4-1.noarch.rpm
Yum Install Postgresql94-server Postgresql94-contrib

Setting up Boot

Systemctl Enable Postgresql-9.4.service
Systemctl Start Postgresql-9.4.service

Initializing the database

/usr/pgsql-9.4/bin/postgresql94-setup Initdb

Turn on remote access

/var/lib/pgsql/9.4/data/postgresql.conf

listen_addresses = ' * '

/var/lib/pgsql/9.4/data/pg_hba.conf

# IPV4 Local connections:
host all All       127.0.0.1/32       192.168.117.1/32    Trust
# IPv6-Connections:
host  all       :: 1/128         

Modify User Password

Su postgres
psql-u postgres
ALTER USER postgres with PASSWORD ' p0stgres '
\q

Firewall

New File/usr/lib/firewalld/services/postgres94.xml

<?xml version= "1.0" encoding= "Utf-8"?>
<service>
    <short>postgres 9.4 Database Service </short>
    <description>Postgres</description>
    <portprotocol= "tcp" port= "5432"/ >
</service>

Modify firewall settings

Firewall-cmd--permanent--add-service=postgres94
firewall-cmd--reload

Thank you for reading, I hope to help you, thank you for your support for this site!

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.