postgresql 11 install

https://yum.postgresql.org/repopackages.php

[root@postgresql ~]# yum install https://download.postgresql.org/pub/repos/yum/11/redhat/rhel-7-x86_64/pgdg-centos11-11-2.noarch.rpm

[root@postgresql ~]# yum install postgresql11-server postgresql11-contrib

[root@postgresql ~]# /usr/pgsql-11/bin/postgresql-11-setup initdb
Initializing database … OK
[root@postgresql ~]# ll /usr/lib/systemd/system/ |grep postgre

[root@postgresql ~]# systemctl enable postgresql-11 –now
Created symlink from /etc/systemd/system/multi-user.target.wants/postgresql-11.service to /usr/lib/systemd/system/postgresql-11.service.
[root@postgresql ~]# systemctl status postgresql-11
● postgresql-11.service - PostgreSQL 11 database server
Loaded: loaded (/usr/lib/systemd/system/postgresql-11.service; enabled; vendor preset: disabled)
Active: active (running) since Tue 2019-02-05 21:37:11 CST; 43s ago
Docs: https://www.postgresql.org/docs/11/static/
Process: 14569 ExecStartPre=/usr/pgsql-11/bin/postgresql-11-check-db-dir ${PGDATA} (code=exited, status=0/SUCCESS)
Main PID: 14575 (postmaster)
CGroup: /system.slice/postgresql-11.service
├─14575 /usr/pgsql-11/bin/postmaster -D /var/lib/pgsql/11/data/
├─14577 postgres: logger
├─14579 postgres: checkpointer
├─14580 postgres: background writer
├─14581 postgres: walwriter
├─14582 postgres: autovacuum launcher
├─14583 postgres: stats collector
└─14584 postgres: logical replication launcher

Feb 05 21:37:11 postgresql.wasu.iot systemd[1]: Starting PostgreSQL 11 database server…
Feb 05 21:37:11 postgresql.wasu.iot postmaster[14575]: 2019-02-05 21:37:11.150 CST [14575] LOG: listening on IPv6 address “::1”, port 5432
Feb 05 21:37:11 postgresql.wasu.iot postmaster[14575]: 2019-02-05 21:37:11.150 CST [14575] LOG: listening on IPv4 address “127.0.0.1”, port 5432
Feb 05 21:37:11 postgresql.wasu.iot postmaster[14575]: 2019-02-05 21:37:11.154 CST [14575] LOG: listening on Unix socket “/var/run/postgresql/.s.PGSQL.5432”
Feb 05 21:37:11 postgresql.wasu.iot postmaster[14575]: 2019-02-05 21:37:11.161 CST [14575] LOG: listening on Unix socket “/tmp/.s.PGSQL.5432”
Feb 05 21:37:11 postgresql.wasu.iot postmaster[14575]: 2019-02-05 21:37:11.174 CST [14575] LOG: redirecting log output to logging collector process
Feb 05 21:37:11 postgresql.wasu.iot postmaster[14575]: 2019-02-05 21:37:11.174 CST [14575] HINT: Future log output will appear in directory “log”.
Feb 05 21:37:11 postgresql.wasu.iot systemd[1]: Started PostgreSQL 11 database server.

修改/var/lib/pgsql/11/data/postgresql.conf

1
listen_addresses = '*'

修改/var/lib/pgsql/11/data/pg_hba.conf,添加

1
host    zabbix          zabbix          10.0.0.0/25          md5

[root@postgresql ~]# systemctl restart postgresql-11
[root@postgresql data]# firewall-cmd –add-service postgresql –permanent
[root@postgresql data]# firewall-cmd –add-service postgresql

[root@postgresql data]# ss -lnpt
State Recv-Q Send-Q Local Address:Port Peer Address:Port
LISTEN 0 128 :22 *: users:((“sshd”,pid=3737,fd=3))
LISTEN 0 128 :5432 *: users:((“postmaster”,pid=15874,fd=3))
LISTEN 0 100 127.0.0.1:25 : users:((“master”,pid=4105,fd=13))
LISTEN 0 128 :::22 :::* users:((“sshd”,pid=3737,fd=4))
LISTEN 0 128 :::5432 :::* users:((“postmaster”,pid=15874,fd=4))
LISTEN 0 100 ::1:25 :::* users:((“master”,pid=4105,fd=14))

坚持原创技术分享,您的支持将鼓励我继续创作!