Red Hat Training

A Red Hat training course is available for RHEL 8

8.9. バックアップからの IdM サーバーの復元

以下の手順では、IdM バックアップから IdM サーバーまたはその LDAP データを復元する方法を説明します。

図8.1 この例で使用されるレプリケーショントポロジー

IdM サーバー 3 台を示す図: server1.example.com ホストはバックアップから復元する必要があります。caReplica2.example.com ホストは、server1.example.com に接続されている認証局レプリカです。replica3.example.com ホストは、caReplica2.example.com に接続する通常のサーバーです。

表8.1 この例で使用されるサーバーの命名規則

サーバーのホスト名機能

server1.example.com

バックアップから復元する必要があるサーバー

caReplica2.example.com

server1.example.com ホストに接続した認証局 (CA) レプリカ。

replica3.example.com

caReplica2.example.com ホストに接続しているレプリカ。

前提条件

  • ipa-backup ユーティリティーを使用して IdM サーバー全体のバックアップまたはデータのみのバックアップを生成している。IdM バックアップの作成 を参照してください。
  • バックアップファイルが /tmp または /var/tmp ディレクトリーにない。
  • 完全なサーバーバックアップからサーバーの完全な復元を実行する前に、サーバーから IdM を アンインストール し、以前と同じサーバー設定を使用して IdM を 再インストール します。

手順

  1. Ipa-restore ユーティリティーを使用して、完全なサーバーまたはデータのみのバックアップを復元します。

    • バックアップディレクトリーがデフォルトの /var/lib/ipa/backup/ の場合は、ディレクトリーの名前のみを入力します。

      [root@server1 ~]# ipa-restore ipa-full-2020-01-14-12-02-32
    • バックアップディレクトリーがデフォルトの場所にない場合は、完全パスを入力します。

      [root@server1 ~]# ipa-restore /mybackups/ipa-data-2020-02-01-05-30-00
      注記

      Ipa-restore ユーティリティーは、ディレクトリーに含まれるバックアップのタイプを自動的に検出し、デフォルトで同じタイプの復元を実行します。完全なサーバーバックアップからデータのみの復元を実行するには、--data オプションを ipa-restore コマンドに追加します。

      [root@server1 ~]# ipa-restore --data ipa-full-2020-01-14-12-02-32
  2. Directory Manager パスワードを入力します。

    Directory Manager (existing master) password:
  3. Yes を入力して、現在のデータをバックアップで上書きしていることを確認します。

    Preparing restore from /var/lib/ipa/backup/ipa-full-2020-01-14-12-02-32 on server1.example.com
    Performing FULL restore from FULL backup
    Temporary setting umask to 022
    Restoring data will overwrite existing live data. Continue to restore? [no]: yes
  4. Ipa-restore ユーティリティーは、利用可能なすべてのサーバーでレプリケーションを無効にします。

    Each master will individually need to be re-initialized or
    re-created from this one. The replication agreements on
    masters running IPA 3.1 or earlier will need to be manually
    re-enabled. See the man page for details.
    Disabling all replication.
    Disabling replication agreement on server1.example.com to caReplica2.example.com
    Disabling CA replication agreement on server1.example.com to caReplica2.example.com
    Disabling replication agreement on caReplica2.example.com to server1.example.com
    Disabling replication agreement on caReplica2.example.com to replica3.example.com
    Disabling CA replication agreement on caReplica2.example.com to server1.example.com
    Disabling replication agreement on replica3.example.com to caReplica2.example.com

    その後、このユーティリティーは IdM サービスを停止し、バックアップを復元し、サービスを再起動します。

    Stopping IPA services
    Systemwide CA database updated.
    Restoring files
    Systemwide CA database updated.
    Restoring from userRoot in EXAMPLE-COM
    Restoring from ipaca in EXAMPLE-COM
    Restarting GSS-proxy
    Starting IPA services
    Restarting SSSD
    Restarting oddjobd
    Restoring umask to 18
    The ipa-restore command was successful
  5. 復元されたサーバーに接続したすべてのレプリカを再初期化します。

    1. domain 接尾辞のレプリカトポロジーセグメントのリストを表示します。復元されたサーバーに関連するトポロジーセグメントを書き留めます。

      [root@server1 ~]# ipa topologysegment-find domain
      ------------------
      2 segments matched
      ------------------
        Segment name: server1.example.com-to-caReplica2.example.com
        Left node: server1.example.com
        Right node: caReplica2.example.com
        Connectivity: both
      
        Segment name: caReplica2.example.com-to-replica3.example.com
        Left node: caReplica2.example.com
        Right node: replica3.example.com
        Connectivity: both
      ----------------------------
      Number of entries returned 2
      ----------------------------
    2. 復元されたサーバーとともにすべてのトポロジーセグメントの domain 接尾辞を再初期化します。

      この例では、server1 からのデータで caReplica2 の再初期化を実行します。

      [root@caReplica2 ~]# ipa-replica-manage re-initialize --from=server1.example.com
      Update in progress, 2 seconds elapsed
      Update succeeded
    3. 認証局データに移動し、ca 接尾辞のレプリケーショントポロジーセグメントのリストを表示します。

      [root@server1 ~]# ipa topologysegment-find ca
      -----------------
      1 segment matched
      -----------------
        Segment name: server1.example.com-to-caReplica2.example.com
        Left node: server1.example.com
        Right node: caReplica2.example.com
        Connectivity: both
      ----------------------------
      Number of entries returned 1
      ----------------------------
    4. 復元されたサーバーに接続されているすべての CA レプリカを再初期化します。

      この例では、server1 からのデータを使用して caReplica2csreplica を再初期化します。

      [root@caReplica2 ~]# ipa-csreplica-manage re-initialize --from=server1.example.com
      Directory Manager password:
      
      Update in progress, 3 seconds elapsed
      Update succeeded
  6. 復元されたサーバー server1.example.com のデータですべてのサーバーが更新されるまで、レプリケーショントポロジーを介して、後続のレプリカを再初期化します。

    この例では、caReplica2 からのデータで、replica3domain 接尾辞を再初期化することのみが必要になります。

    [root@replica3 ~]# ipa-replica-manage re-initialize --from=caReplica2.example.com
    Directory Manager password:
    
    Update in progress, 3 seconds elapsed
    Update succeeded
  7. すべてのサーバーで SSSD のキャッシュをクリアし、無効なデータによる認証の問題を回避します。

    1. SSSD サービスを停止します。

      [root@server ~]# systemctl stop sssd
    2. SSSD からキャッシュされたコンテンツをすべて削除します。

      [root@server ~]# sss_cache -E
    3. SSSD サービスを起動します。

      [root@server ~]# systemctl start sssd
    4. サーバーを再起動します。

関連情報

  • ipa-restore(1) の man ページでは、復元中の複雑なレプリケーションシナリオの処理方法が詳細に説明されています。