There are two installation methods postgresql11: binary source installation, rpm package installation
wget https://ftp.postgresql.org/pub/source/v11.5/postgresql-11.5.tar.gz ./configure --prefix=/u01/pgsql make make install wget http://download.postgresql.org/pub/repos/yum/testing/11/redhat/rhel-6-x86_64/postgresql11-server-11.5-1PGDG.rhel6.x86_64.rpm wget https://yum.postgresql.org/testing/11/redhat/rhel-6-x86_64/postgresql11-11.5-1PGDG.rhel6.x86_64.rpm wget https://yum.postgresql.org/testing/11/redhat/rhel-6-x86_64/postgresql11-contrib-11.5-1PGDG.rhel6.x86_64.rpm wget https://yum.postgresql.org/testing/11/redhat/rhel-6-x86_64/postgresql11-libs-11.5-1PGDG.rhel6.x86_64.rpm wget https://ftp.postgresql.org/pub/source/v11.5/postgresql-11.5.tar.gz ./configure --prefix=/u01/pgsql make make install wget http://download.postgresql.org/pub/repos/yum/testing/11/redhat/rhel-6-x86_64/postgresql11-server-11.5-1PGDG.rhel6.x86_64.rpm wget https://yum.postgresql.org/testing/11/redhat/rhel-6-x86_64/postgresql11-11.5-1PGDG.rhel6.x86_64.rpm wget https://yum.postgresql.org/testing/11/redhat/rhel-6-x86_64/postgresql11-contrib-11.5-1PGDG.rhel6.x86_64.rpm wget https://yum.postgresql.org/testing/11/redhat/rhel-6-x86_64/postgresql11-libs-11.5-1PGDG.rhel6.x86_64.rpm rpm -ivh postgresql11-libs-11.5-1PGDG.rhel6.x86_64.rpm rpm -ivh postgresql11-11.5-1PGDG.rhel6.x86_64.rpm rpm -ivh postgresql11-contrib-11.5-1PGDG.rhel6.x86_64.rpm rpm -ivh postgresql11-server-11.5-1PGDG.rhel6.x86_64.rpm
But before the installation of the two must first build a user and group directory and edit user environment variables need to set up strict sysctl.conf and limits.conf
groupadd postgres useradd -g postgres postgres passwd postgres mkdir -p /u01/pgsql chown -R postgres:postgres /u01/pgsql chmod -R 775 /u01/pgsql export PGHOME=/u01/pgsql export PGDATA=/u01/pgsql/data export PATH=$PATH:$HOME/bin:$PGHOME/bin
After the installation needs to be copied from what rpm under / usr / local / pgsql-11 to / u01 / pgsql
Initialization initdb
Start postgresql pg_ctl start
Modify the network configuration file pg_hba.conf
host all all 192.168.20.0/24 trust - on the production of this configuration is unsafe
Modifying the master configuration file postgresql.conf
Listener address listen_addresses = '192.168.20.202'
Port #port = 5432