PostgreSQL Version13 インストール手順 (RHEL系Linux)¶
警告
dnf module install postgresql:13/server を使用してください。MaxGaugeサーバがサポートするLinux OS(RHEL, CentOS、OracleLinux)へのPostgreSQL Version13のインストール手順を紹介します。 手順は、PostgreSQLの公式YUMリポジトリよりインストールする手順とRPMファイルをダウンロードしてインストールする手順を紹介します、 MaxGaugeサーバの環境にあわせてインストールしてください。
※ MaxGaugeのユーティリティツールで利用するPython用のPostgreSQLドライバもインストールします
OS |
インストール |
|---|---|
RHEL7(CentOS7,OracleLinux7) |
|
RHEL8(CentOS8,OracleLinux8) |
|
PostgreSQLの公式リポジトリよりインストール¶
PostgreSQLの公式リポジトリよりインストールします。MaxGaugeサーバがインターネットにアクセス出来る必要があります。
リポジトリ情報のRPMファイルをインストールします
[root]# rpm -ivh https://download.postgresql.org/pub/repos/yum/reporpms/EL-8-x86_64/pgdg-redhat-repo-latest.noarch.rpm
インストール
[root]# dnf --disablerepo=* --enablerepo=pgdg13 install \ postgresql13 \ postgresql13-server \ postgresql13-libs
データベースの初期化
[root]# postgresql-13-setup initdb
PostgreSQLサービスの起動
[root]# systemctl start postgresql-13.service
Python3のPostgreSQLドライバをインストール
[root]# dnf install --disablerepo=* --enablerepo=pgdg-common python3-psycopg2
リポジトリ情報のRPMファイルをインストールします
[root]# rpm -ivh https://download.postgresql.org/pub/repos/yum/reporpms/EL-7-x86_64/pgdg-redhat-repo-latest.noarch.rpm
インストール
[root]# yum --disablerepo=* --enablerepo=pgdg13 install \ postgresql13 \ postgresql13-server \ postgresql13-libs
データベースの初期化
[root]# postgresql-13-setup initdb
PostgreSQLサービスの起動
[root]# systemctl start postgresql-13.service
PythonのPostgreSQLドライバをインストール
[root]# yum install --disablerepo=* --enablerepo=pgdg-common python-psycopg2
PostgreSQLのRPMをダウンロードしてインストール¶
YUMリポジトリのURLよりRPMをダウンロードする
ダウンロードURL
ダウンロードするRPM 1番目のURLよりダウンロードします。
postgresql13-13.*-*PGDG.rhel8.x86_64.rpmpostgresql13-server-13.*-*PGDG.rhel8.x86_64.rpmpostgresql13-libs-13.*-*PGDG.rhel8.x86_64.rpm
ダウンロードするRPM(PostgreSQLドライバ)2番目のURLよりダウンロードします。
python3-psycopg2-2.8.*-*.rhel8.x86_64
ダウンロードしたRPMをMaxGaugeサーバへアップロードします
アップロードしたRPMをインストールします
[root]# rpm -ivh ./postgresql13-13.*-*PGDG.rhel8.x86_64.rpm \ ./postgresql13-server-13.*-*PGDG.rhel8.x86_64.rpm \ ./postgresql13-libs-13.*-*PGDG.rhel8.x86_64.rpm
データベースの初期化
[root]# postgresql-13-setup initdb
PostgreSQLサービスの起動
[root]# systemctl start postgresql-13.service
PythonのPostgreSQLドライバをインストール
[root]# rpm -ivh ./python3-psycopg2-2.8.*-*.rhel8.x86_64
YUMリポジトリのURLよりRPMをダウンロードする
ダウンロードURL
ダウンロードするRPM 1番目のURLよりダウンロードします。
postgresql13-13.*-*PGDG.rhel7.x86_64.rpmpostgresql13-server-13.*-*PGDG.rhel7.x86_64.rpmpostgresql13-libs-13.*-*PGDG.rhel7.x86_64.rpm
ダウンロードするRPM(PostgreSQLドライバ)2番目のURLよりダウンロードします。
python-psycopg2-2.7.*-*.rhel7.x86_64
ダウンロードしたRPMをMaxGaugeサーバへアップロードします
アップロードしたRPMをインストールします
[root]# rpm -ivh ./postgresql13-13.*-*PGDG.rhel7.x86_64.rpm \ ./postgresql13-server-13.*-*PGDG.rhel7.x86_64.rpm \ ./postgresql13-libs-13.*-*PGDG.rhel7.x86_64.rpm
データベースの初期化
[root]# postgresql-13-setup initdb
PostgreSQLサービスの起動
[root]# systemctl start postgresql-13.service
PythonのPostgreSQLドライバをインストール
[root]# rpm -ivh ./python-psycopg2-2.7.*-*.rhel7.x86_64
[RHEL8] AppStream よりインストール¶
ヒント
この手順は、RHEL8系の環境のみ対象となります
Postgres10のインストール
[root]# dnf module install postgresql:13
データベースの初期化
[root]# postgresql-setup initdb
PostgreSQLサービスの起動
[root]# systemctl start postgresql.service
PythonのPostgreSQLドライバをインストール
[root]# dnf install python3-psycopg2