3.6. 外部データベースへの移行

既存のデータをバックアップおよび転送してから、satellite-installer コマンドを使用して、外部の MongoDB および PostgreSQL データベースに接続するように Satellite を設定します。

前提条件

  • Red Hat Enterprise Linux サーバーに MongoDB および PostgreSQL データベースをインストールおよび設定していること。

手順

  1. Satellite Server で、satellite-maintain サービスを停止します。

    # satellite-maintain service stop
  2. postgreSQL および mongod のサービスを起動します。

    # systemctl start postgresql
    # systemctl start mongod
  3. 内部データベースのバックアップを作成します。

    # satellite-maintain backup online --skip-pulp-content --preserve-directory -y /var/migration_backup
  4. データを新規外部データベースに転送します。

    PGPASSWORD='Foreman_Password' pg_restore -h postgres.example.com -U foreman -d foreman < /var/migration_backup/foreman.dump
    PGPASSWORD='Candlepin_Password' pg_restore -h postgres.example.com -U candlepin -d candlepin < /var/migration_backup/candlepin.dump
    mongorestore --host mongo.example.com --db pulp_database --username pulp_user --password pulp_password /var/migration_backup/mongo_dump/pulp_database/
  5. satellite-installer コマンドを使って Satellite が新規データベースを参照するように更新します。

    satellite-installer --scenario satellite \
        --foreman-db-host postgres.example.com \
        --foreman-db-password Foreman_Password \
        --foreman-db-database foreman \
        --foreman-db-manage false \
        --katello-candlepin-db-host postgres.example.com \
        --katello-candlepin-db-name candlepin \
        --katello-candlepin-db-password Candlepin_Password \
        --katello-candlepin-manage-db false \
        --katello-pulp-db-username pulp \
        --katello-pulp-db-password pulp_password \
        --katello-pulp-db-seeds mongo.example.com:27017 \
        --katello-pulp-db-name pulp_database \
        --katello-pulp-manage-db false