Test the PostgreSQL cluster

Source: Internet
Author: User
Tags postgresql psql

First, yum installation Pgsql10
Two

First, yum installation Pgsql10

    1. Install Pgsql First
      Environment CentOS 7 64-bit
      Database: Pg10dev
      Reference URL:
      http://blog.csdn.net/silenceray/article/details/70577610

Create user

[[Email protected] ~] #useradd postgres

Configure your Yum repository

[Email protected] ~]# Vim/etc/yum.repos.d/centos-base.repo
add between [base] and [Updates] sections:
exclude=postgresql*

Installing the RPM file for PG

[email protected] ~]# Yum Localinstall https://download.postgresql.org/pub/repos/yum/testing/10/redhat/rhel-7-x86_ 64/pgdg-centos10-10-1.noarch.rpm

Installing the PG Database
[email protected] ~]# Yum list postgresql*

[email protected] ~]# Yum install postgresql10-server.x86_64
[Email protected] ~]# mkdir postgres/var/lib/pgsql/10/data
Initializing the database
[Email protected] ~]#/usr/pgsql-10/bin/postgresql10-setup initdb
Initializing database ... Ok

[Email protected] ~]# Su-postgres

[Email protected] ~]$/usr/pgsql-10/bin/pg_ctl-d/var/lib/pgsql/10/data start

[Email protected] ~]$/usr/pgsql-10/bin/psql-p 5432
Psql (10devel)
Enter "Help" for information.

postgres=#

Installation is complete!

    1. Configure Pgsql to enable clients to access
      2.1 Change Password
      (1) Su Postgres
      (2) Psql-u postgres-p5433
      (3) Alter user postgres with password ' postgres ';

2.2 Modify the configuration file to allow remote login.
and pg_hba.conf a directory of, Postgresql.conf,

    listen_addresses = ‘localhost‘ ,改成listen_addresses = ‘*‘

2.3 Modifying ports

Test the PostgreSQL cluster

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.