PostgreSQL Version9.6 インストール手順 (RHEL系Linux)¶
MaxGaugeサーバがサポートするLinux OS(RHEL, CentOS、OracleLinux)へのPostgreSQL Version9.6のインストール手順を紹介します。 手順は、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=pgdg96 install \ postgresql96 \ postgresql96-server \ postgresql96-libsデータベースの初期化
postgresql-9.6-setup initdbPostgreSQLサービスの起動
systemctl start postgresql-9.6.servicePython3のPostgreSQLドライバをインストール
yum install --disablerepo=* --enablerepo=pgdg96 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=pgdg96 install \ postgresql96 \ postgresql96-server \ postgresql96-libsデータベースの初期化
postgresql-9.6-setup initdbPostgreSQLサービスの起動
systemctl start postgresql-9.6.servicePythonのPostgreSQLドライバをインストール
yum install --disablerepo=* --enablerepo=pgdg96 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=pgdg96 install \ postgresql96 \ postgresql96-server \ postgresql96-libsデータベースの初期化
/etc/init.d/postgresql-9.6 initdbPostgreSQLサービスの起動
service postgresql-9.6 startPythonのPostgreSQLドライバをインストール
yum install --disablerepo=* --enablerepo=pgdg96 python-psycopg2
PostgreSQLのRPMをダウンロードしてインストール¶
RHEL8
YUMリポジトリのURLよりRPMをダウンロードする
URL : https://download.postgresql.org/pub/repos/yum/9.6/redhat/rhel-8-x86_64/
ダウンロードするRPM
ダウンロードするRPM(PostgreSQLドライバ)
python3-psycopg2-2.8.*-*.rhel8.x86_64
ダウンロードしたRPMをMaxGaugeサーバへアップロードします
アップロードしたRPMをインストールします
rpm -ivh ./postgresql96-9.6.*-*PGDG.rhel8.x86_64.rpm \ ./postgresql96-server-9.6.*-*PGDG.rhel8.x86_64.rpm \ ./postgresql96-libs-9.6.*-*PGDG.rhel8.x86_64データベースの初期化
postgresql-9.6-setup initdbPostgreSQLサービスの起動
systemctl start postgresql-9.6.servicePythonのPostgreSQLドライバをインストール
rpm -ivh ./python3-psycopg2-2.8.*-*.rhel8.x86_64
RHEL7
YUMリポジトリのURLよりRPMをダウンロードする
URL : https://download.postgresql.org/pub/repos/yum/9.6/redhat/rhel-7-x86_64/
ダウンロードするRPM
ダウンロードするRPM(PostgreSQLドライバ)
python-psycopg2-2.7.*-*.rhel7.x86_64
ダウンロードしたRPMをMaxGaugeサーバへアップロードします
アップロードしたRPMをインストールします
rpm -ivh ./postgresql96-9.6.**-*PGDG.rhel7.x86_64.rpm \ ./postgresql96-server-9.6.**-*PGDG.rhel7.x86_64.rpm \ ./postgresql96-libs-9.6.**-*PGDG.rhel7.x86_64.rpmデータベースの初期化
postgresql-9.6-setup initdbPostgreSQLサービスの起動
systemctl start postgresql-9.6.servicePythonのPostgreSQLドライバをインストール
rpm -ivh ./python-psycopg2-2.7.*-*.rhel7.x86_64
RHEL6
YUMリポジトリのURLよりRPMをダウンロードする
URL : https://download.postgresql.org/pub/repos/yum/9.6/redhat/rhel-6-x86_64/
ダウンロードするRPM
ダウンロードするRPM(PostgreSQLドライバ)
python-psycopg2-2.7.*-*.rhel6.x86_64
ダウンロードしたRPMをMaxGaugeサーバへアップロードします
アップロードしたRPMをインストールします
rpm -ivh ./postgresql96-9.6.**-*PGDG.rhel6.x86_64.rpm \ ./postgresql96-server-9.6.**-*PGDG.rhel6.x86_64.rpm \ ./postgresql96-libs-9.6.**-*PGDG.rhel6.x86_64.rpmデータベースの初期化
/etc/init.d/postgresql-9.6 initdbPostgreSQLサービスの起動
service postgresql-9.6 startPythonのPostgreSQLドライバをインストール
rpm -ivh ./python-psycopg2-2.7.*-*.rhel6.x86_64
[RHEL8] AppStream よりインストール¶
ヒント
この手順は、RHEL8系の環境のみ対象となります
RHEL8:手順
Postgres9.6のインストール
dnf module install postgresql:9.6データベースの初期化
postgresql-setup initdbPostgreSQLサービスの起動
systemctl start postgresql.servicePythonのPostgreSQLドライバをインストール
dnf install python3-psycopg2