1. CentOSのVersion確認(必須では、ありませんので、必要に応じて、行ってください)
cat /etc/redhat-release
3.
rpm -ivh pgdg-centos96-9.6-3.noarch.rpm
4.
yum -y install postgresql96-server postgresql96-devel postgresql96-contrib
5. -setupの検索 (必須では、ありませんので、必要に応じて、行ってください)
/usr/pgsql-9.6/bin/postgresql96-setup initdb --no-locale
/usr/pgsql-9.6/bin/postgresql96-setup initdb --locale=C
/usr/pgsql-9.6/bin/postgresql96-setup initdb --encoding=UTF8 --no-locale
/usr/pgsql-9.6/bin/postgresql96-setup initdb --encoding=UTF-8 --locale=ja_JP.UTF-8
オプションがエラーになる
/usr/pgsql-9.6/bin/postgresql96-setup initdb はOK。
8. conf の検索 (必須では、ありませんので、必要に応じて、行ってください)
find / -name "pg*.conf" -print
9. confを編集し、接続許可
vi /var/lib/pgsql/9.6/data/pg_hba.conf
systemctl start postgresql-9.6
systemctl enable postgresql-9.6
11. 起動確認とデータベースの作成 (必須では、ありませんので、必要に応じて、行ってください)
su postgres
psql
CREATE DATABASE test1;
\l
\q
exit
12. PostgreSQLバージョン確認 (必須では、ありませんので、必要に応じて、行ってください)
psql --version
13. PostgreSQLの再起動
systemctl restart postgresql-9.6
14. Firewallの設定
firewall-cmd --add-service=postgresql --zone=public --permanent

ファイアーウォールの再起動
systemctl restart firewalld
参照元
稼働中のサービスの確認
systemctl list-units --type=service
定義されているサービス一覧
systemctl list-unit-files --type=service
サービス状態
systemctl status sshd
systemctl status postgresql-9.6
接続許可につてい
pg_hba.confの編集で、下記を試したが、trust以外は、pgadminVから、接続できませんでした。
host all all 192.168.24.0/24 trust
host all all 192.168.24.0/24 md5
host all all 192.168.24.0/24 password
host all all 192.168.24.0/24 krb5
host all all 192.168.24.0/24 ident
host all all 192.168.24.0/24 cert
1. trust
2. md5
GUIインストールでは、有効でしたが、上記コマンドラインからの手順では、接続えらーになりました。
3. password
4. krb5
5. ident
6. cert