Red Hat Training

A Red Hat training course is available for Red Hat Directory Server

15.2.4. コマンドラインからのレプリカ合意の設定

レプリカ合意を設定する場合は、まずすべてのサプライヤー間で設定してから、サプライヤーとハブの間で、最後にハブとコンシューマーの間を設定します。
レプリカ合意は、8 つの個別の属性を定義する必要があります。
  • コンシューマーホスト(nsds5replicahost)およびポート(nsds5replicaport)
  • コンシューマーにバインドするために使用するサプライヤーの DN(nsds5ReplicaBindDN)。
  • サプライヤーがバインドする方法(nsds5replicabindmethod)。
  • バインドメソッドおよび指定された DN に必要な認証情報(nsDS5ReplicaCredentials)。
  • 複製されるサブツリー(nsds5replicaroot)。
  • レプリケーションスケジュール(nsds5replicaupdateschedule)
  • 複製されない属性 nsds5replicatedattributelist および nsDS5ReplicatedAttributeListTotal)。
ldapmodify を使用して、更新するすべてのコンシューマーのすべてのサプライヤーにレプリカ合意を追加します。以下に例を示します。

例15.3 レプリカ合意エントリーの例

dn: cn=ExampleAgreement,cn=replica,cn=dc\=example\,dc\=com,cn=mapping tree,cn=config
objectclass: top
objectclass: nsds5ReplicationAgreement
cn: ExampleAgreement
nsds5replicahost: consumer1
nsds5replicaport: 389
nsds5ReplicaBindDN: cn=replication manager,cn=config
nsds5replicabindmethod: SIMPLE
nsds5replicaroot: dc=example,dc=com
description: agreement between supplier1 and consumer1
nsds5replicaupdateschedule: 0000-0500 1
nsds5replicatedattributelist: (objectclass=*) $ EXCLUDE authorityRevocationList accountUnlockTime memberof
nsDS5ReplicatedAttributeListTotal: (objectclass=*) $ EXCLUDE accountUnlockTime
nsds5replicacredentials: secret
例で使用するパラメーターの説明と、cn=agreement_name,cn=replica,cn=suffix_ DN,cn=mapping tree,cn=config エントリーで設定できるパラメーターの説明は、Red Hat Directory Server の設定、コマンド、およびファイルリファレンス を参照してください。
すべてのレプリカ合意を作成したら、コンシューマーの初期化を開始します。

15.2.4.1. 証明書ベースの認証を使用するようにレプリケーションパートナーの設定

レプリケーションパートナーに対するバインド DN およびパスワードを使用する代わりに、証明書ベースの認証を使用できます。
以下の手順では、レプリケーショントポロジーに server2.example.com という名前の新規サーバーを追加する方法を説明します。また、証明書ベースの認証を使用して、新規ホストと既存の server1.example.com との間でレプリカ合意を設定する方法を説明します。
  1. 両方のホストで、証明書ベースの認証を設定します。詳細は「証明書ベースの認証の設定」を参照してください。
  2. server1.example.com ホスト上で:
    1. 両方のサーバー (cn=server1,example,dc=comcn=server2,dc=example,dc=com など) にアカウントを作成し、クライアント証明書を対応するアカウントに追加します。詳細は、次を参照してください。
      両方のサーバーは、後でこれらのアカウントと証明書を使用して、相互にレプリケーション接続を確立するときに認証を行います。
    2. cn=repl_server,ou=Groups,dc=example,dc=com などのグループを作成し、両方のサーバーアカウントを追加します。「コマンドラインでのグループの作成」 を参照してください。
    3. レプリカエントリーを作成し、nsds5ReplicaBindDNGroup 属性を直前の手順で作成されたグループの DN に設定します。
      # ldapmodify -D "cn=Directory Manager" -W -p 636 -h server1.example.com -x
      
      dn: cn=replica,cn=dc\=example\,dc\=com,cn=mapping tree,cn=config
      changetype: add
      objectclass: top
      objectclass: nsds5replica
      objectclass: extensibleObject
      cn: replica
      nsds5replicaroot: dc=example,dc=com
      nsds5replicaid: 7
      nsds5replicatype: 3
      nsds5flags: 1
      nsds5ReplicaPurgeDelay: 604800
      nsds5replicabinddngroup: cn=repl_server,ou=Groups,dc=example,dc=com
      nsDS5ReplicaBindDNGroupCheckInterval: 0
      重要
      以下の例に示すように、レプリカエントリーの cn パラメーターを replica に設定する必要があります。Directory Server は、パラメーターを異なる値に設定するとエントリーを無視します。
  3. 新しいサーバーを初期化します。
    1. server2.example.com で、cn=Replication Manager,cn=config などの一時的なレプリケーションマネージャーアカウントを作成します。「サプライヤーバインド DN エントリーの作成」 を参照してください。
    2. server1.example.com で、認証用に直前の手順でアカウントを使用する一時的なレプリカ合意を作成します。
      # ldapmodify -D "cn=Directory Manager" -W -p 636 -h server1.example.com -x
      
      dn: cn=temporary_agreement,cn=replica,cn=dc\=example\,dc\=com,cn=mapping tree,cn=config
      objectclass: top
      objectclass: nsds5ReplicationAgreement
      cn: temporary_agreement
      nsds5replicahost: server2.example.com
      nsds5replicaport: 636
      nsds5replicabindmethod: SIMPLE
      nsds5ReplicaBindDN: cn=Replication Manager,cn=config
      nsds5replicacredentials: password_of_replication_manager_account
      nsds5replicaroot: dc=example,dc=com
      description: Temporary agreement between server1 and server2
      nsds5replicaupdateschedule: 0000-0500 1
      nsds5replicatedattributelist: (objectclass=*) $ EXCLUDE authorityRevocationList accountUnlockTime memberof
      nsDS5ReplicatedAttributeListTotal: (objectclass=*) $ EXCLUDE accountUnlockTime
      nsds5BeginReplicaRefresh: start
      
      この合意は、以前に作成したレプリケーションマネージャーアカウントを使用してデータベースを初期化します。この初期化前に、server2.example.com のデータベースが空で、関連する証明書を持つアカウントは存在しません。したがって、データベースの初期化前に、証明書を使用してレプリケーションすることはできません。
  4. 新しいサーバーが初期化された後
    1. server1.example.com から一時的なレプリカ合意を削除します。
      # ldapdelete -D "cn=Directory Manager" -W -p 636 -h server1.example.com -x "cn=temporary_agreement,cn=replica,cn=dc\=example\,dc\=com,cn=mapping tree,cn=config"
    2. server2.example.com から一時的なレプリケーションマネージャーアカウントを削除します。
      # ldapdelete -D "cn=Directory Manager" -W -p 636 -h server2.example.com -x "cn=Replication Manager,cn=config"
  5. 証明書ベースの認証を使用する両サーバーでレプリカ合意を作成します。
    1. server1.example.com 上で:
      # ldapmodify -D "cn=Directory Manager" -W -p 636 -h server1.example.com -x
      
      dn: cn=example_agreement,cn=replica,cn=dc\=example\,dc\=com,cn=mapping tree,cn=config
      objectclass: top
      objectclass: nsds5ReplicationAgreement
      cn: example_agreement
      nsds5replicahost: server2.example.com
      nsds5replicaport: 636
      nsds5replicabindmethod: SSLCLIENTAUTH
      nsds5replicaroot: dc=example,dc=com
      description: Agreement between server1 and server2
      nsds5replicaupdateschedule: 0000-0500 1
      nsds5replicatedattributelist: (objectclass=*) $ EXCLUDE authorityRevocationList accountUnlockTime memberof
      nsDS5ReplicatedAttributeListTotal: (objectclass=*) $ EXCLUDE accountUnlockTime
      nsDS5ReplicaTransportInfo: SSL
    2. server2.example.com 上で:
      # ldapmodify -D "cn=Directory Manager" -W -p 636 -h server2.example.com -x
      
      dn: cn=example_agreement,cn=replica,cn=dc\=example\,dc\=com,cn=mapping tree,cn=config
      objectclass: top
      objectclass: nsds5ReplicationAgreement
      cn: example_agreement
      nsds5replicahost: server1.example.com
      nsds5replicaport: 636
      nsds5replicabindmethod: SSLCLIENTAUTH
      nsds5replicaroot: dc=example,dc=com
      description: Agreement between server2 and server1
      nsds5replicaupdateschedule: 0000-0500 1
      nsds5replicatedattributelist: (objectclass=*) $ EXCLUDE authorityRevocationList accountUnlockTime memberof
      nsDS5ReplicatedAttributeListTotal: (objectclass=*) $ EXCLUDE accountUnlockTime
      nsDS5ReplicaTransportInfo: SSL
  6. レプリケーションが正しく機能していることを確認するには、レプリカ合意に nsds5replicaLastUpdateStatus 属性を表示します。
    # ldapsearch -D "cn=Directory Manager" -W -p 636 -h server1.example.com -b "cn=example_agreement,cn=replica,cn=dc\=example\,dc\=com,cn=mapping tree,cn=config" nsds5replicaLastUpdateStatus
    可能なステータスの詳細は、Red 『Hat Directory Server の設定、コマンド、およびファイルリファレンス の付録 レプリカ合意の状況 を参照してください』。