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