付録B 手動設定のローカル PostgreSQL データベースの準備

以下の手順に従って、Manager データベースを設定します。Manager を設定する前に、このデータベースを準備します。engine-setup の実行中に、データベースの認証情報を提示する必要があるためです。

注記

engine-setup および engine-backup --mode=restore コマンドは、システムロケールが異なる場合でも、en_US.UTF8 ロケールのシステムエラーメッセージだけをサポートします。

postgresql.conf ファイルのロケール設定は en_US.UTF8 に設定する必要があります。

重要

データベース名には、数字、アンダースコア、小文字しか使用できません。

Red Hat Virtualization Manager リポジトリーの有効化

ログインして、Red Hat Subscription Manager で Manager マシンを登録し、Red Hat Virtualization Manager のサブスクリプションをアタッチして Manager のリポジトリーを有効にする必要があります。

手順

  1. コンテンツ配信ネットワークにシステムを登録します。プロンプトが表示されたら、カスタマーポータルのユーザー名とパスワードを入力します。

    # subscription-manager register
    注記

    IPv6 ネットワークを使用している場合は、IPv6 移行メカニズムを使用して、コンテンツ配信ネットワークおよびサブスクリプションマネージャーにアクセスします。

  2. Red Hat Virtualization Manager のサブスクリプションプールを見つけ、プール ID を記録します。

    # subscription-manager list --available
  3. 上記のプール ID を使用して、サブスクリプションをシステムにアタッチします。

    # subscription-manager attach --pool=pool_id
    注記

    現在アタッチされているサブスクリプションを表示するには、以下のコマンドを実行します。

    # subscription-manager list --consumed

    有効なリポジトリーをすべて一覧表示するには、以下のコマンドを実行します。

    # dnf repolist
  4. リポジトリーを設定します。

    # subscription-manager repos \
        --disable='*' \
        --enable=rhel-8-for-x86_64-baseos-eus-rpms \
        --enable=rhel-8-for-x86_64-appstream-eus-rpms \
        --enable=rhv-4.4-manager-for-rhel-8-x86_64-rpms \
        --enable=fast-datapath-for-rhel-8-x86_64-rpms \
        --enable=jb-eap-7.4-for-rhel-8-x86_64-rpms \
        --enable=openstack-16.2-cinderlib-for-rhel-8-x86_64-rpms \
        --enable=rhceph-4-tools-for-rhel-8-x86_64-rpms \
        --enable=rhel-8-for-x86_64-appstream-tus-rpms \
        --enable=rhel-8-for-x86_64-baseos-tus-rpms
  5. RHEL のバージョンを 8.6 に設定します。

    # subscription-manager release --set=8.6
  6. postgresql モジュールのバージョン 12 を有効にします。

    # dnf module -y enable postgresql:12
  7. nodejs モジュールのバージョン 14 を有効にします。

    # dnf module -y enable nodejs:14
  8. インストール済みパッケージを同期して、利用可能な最新バージョンに更新します。

    # dnf distro-sync --nobest

関連情報

モジュールおよびモジュールストリームの詳細は、ユーザー空間コンポーネントのインストール、管理、および削除 の以下のセクションを参照してください。

PostgreSQL データベースの初期化

  1. PostgreSQL サーバーパッケージをインストールします。

    # dnf install postgresql-server postgresql-contrib
  2. PostgreSQL データベースインスタンスを初期化します。

    # postgresql-setup --initdb
  3. postgresql サービスを起動し、このサービスがブート時に起動されるようにします。

    # systemctl enable postgresql
    # systemctl start postgresql
  4. psql コマンドラインインターフェイスに postgres ユーザーとして接続します。

    # su - postgres -c psql
  5. デフォルトユーザーを作成します。Manager のデフォルトのユーザーは engine で、Data Warehouse のデフォルトユーザーは ovirt_engine_history です。

    postgres=# create role user_name with login encrypted password 'password';
  6. データベースを作成します。Manager のデフォルトのデータベース名は engine で、Data Warehouse のデフォルトのデータベース名は ovirt_engine_history です。

    postgres=# create database database_name owner user_name template template0 encoding 'UTF8' lc_collate 'en_US.UTF-8' lc_ctype 'en_US.UTF-8';
  7. 新しいデータベースに接続します。

    postgres=# \c database_name
  8. uuid-ossp 拡張機能を追加します。

    database_name=# CREATE EXTENSION "uuid-ossp";
  9. plpgsql 言語が存在しない場合は追加します。

    database_name=# CREATE LANGUAGE plpgsql;
  10. psql インターフェイスを終了します。

    database_name=# \q
  11. /var/lib/pgsql/data/pg_hba.conf ファイルを編集し、md5 クライアント認証を有効にし、エンジンがローカルでデータベースにアクセスできるようにします。ファイルの下部にある local で始まる行のすぐ下に、以下の行を追加します。

    host    database_name    user_name    0.0.0.0/0    md5
    host    database_name    user_name    ::0/0   md5
  12. PostgreSQL サーバーの設定を更新します。/var/lib/pgsql/data/postgresql.conf ファイルを編集し、以下の行をファイルの下部に追加します。

    autovacuum_vacuum_scale_factor=0.01
    autovacuum_analyze_scale_factor=0.075
    autovacuum_max_workers=6
    maintenance_work_mem=65536
    max_connections=150
    work_mem=8192
  13. postgresql サービスを再起動します。

    # systemctl restart postgresql
  14. オプションで、データベース接続を保護するために SSL をセットアップします。

Manager の設定 に戻り、データベースについて尋ねられたら Local および Manual と答えます。