Red Hat Training

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

第17章 コンテンツの同期の設定

Content Synchronization プラグインを使用すると、Directory Server は RFC 4533 に従って SyncRepl プロトコルをサポートします。このプロトコルにより、LDAP サーバーとクライアントは Red Hat Directory Server をソースとして使用し、ローカルデータベースを Directory Server の変更するコンテンツと同期させることができます。
SyncRepl プロトコルを使用するには、以下を実行します。
  • Directory Server で Content Synchronization プラグインを有効にし、必要に応じてクライアントが Directory Server にバインドするために使用する新規ユーザーを作成します。アカウントには、ディレクトリー内のコンテンツを読み取るパーミッションが必要です。
  • クライアントを設定します。たとえば、同期するサブツリーの検索ベースを設定します。詳細は、クライアントのドキュメントを参照してください。
クライアントが Directory Server に接続できるようにするには、Content Synchronization プラグインを設定します。
  1. Content Synchronization プラグインでは、nsuniqueid 属性をログに記録するのに Retro Changelog プラグインが必要です。
    1. Retro Changelog が有効になっているかどうかを確認するには、次のコマンドを実行します。
      # ldapsearch -D "cn=Directory Manager" -W -x -b \
           'cn=Retro Changelog Plugin,cn=plugins,cn=config' nsslapd-pluginEnabled
      ...
      dn: cn=Retro Changelog Plugin,cn=plugins,cn=config
      nsslapd-pluginEnabled: off
      nsslapd-pluginEnabled 属性が off に設定されている場合、Retro Changelog は無効になります。有効にする場合は、「Retro Changelog プラグインの有効化」 を参照してください。
    2. nsuniqueid 属性を、Retro Changelog プラグインの設定に追加します。
      # ldapmodify -D "cn=Directory Manager" -W -p 389 -h server.example.com -x
      
      dn: cn=Retro Changelog Plugin,cn=plugins,cn=config
      changetype: add
      add: nsslapd-attribute
      nsslapd-attribute: nsuniqueid:targetUniqueId
    3. 必要に応じて、パフォーマンスを向上させるために、以下の推奨事項を適用します。
      1. Retro Changelog のエントリーの最大有効期間を設定します。たとえば、2 日 (2d) を設定するには、以下のコマンドを実行します。
        # ldapmodify -D "cn=Directory Manager" -W -p 389 -h server.example.com -x
        
        dn: cn=changelog5,cn=config
        changetype: modify
        replace: nsslapd-changelogmaxage
        nsslapd-changelogmaxage: 2d
      2. データを同期するバックエンドまたはサブツリーのクライアントアクセスを把握している場合は、Retro Changelog プラグインのスコープを制限します。たとえば、cn=demo,dc=example,dc=com サブツリーを除外するには、以下を入力します。
        # ldapmodify -D "cn=Directory Manager" -W -p 389 -h server.example.com -x
        
        dn: cn=Retro Changelog Plugin,cn=plugins,cn=config
        changetype: modify
        replace: nsslapd-exclude-suffix
        nsslapd-exclude-suffix: cn=demo,dc=example,dc=com
  2. Content Synchronization プラグインを有効にします。
    • コマンドラインの使用するには、以下を行います。
      # ldapmodify -D "cn=Directory Manager" -W -p 389 -h server.example.com -x
      
      dn: cn=Retro Changelog Plugin,cn=plugins,cn=config
      changetype: modify
      replace: nsslapd-pluginEnabled
      nsslapd-pluginEnabled: on
    • Directory Server コンソールの使用: 「Directory Server コンソールでプラグインの有効化」 を参照してください。
  3. デフォルトの Directory Server は、oid=1.3.6.1.4.1.4203.1.9.1.1,cn=features,cn=config エントリーにアクセス制御命令 (ACI) を作成し、すべてのユーザーが SyncRepl プロトコルを使用できるようにします。
    aci: (targetattr != "aci")(version 3.0; acl "Sync Request Control";
       allow( read, search ) userdn = "ldap:///all";)
    必要に応じて、SyncRepl コントロールを使用して ACI を制限するように更新します。ACI の詳細は、「バインドルールの定義」を参照してください。
  4. Directory Server を再起動します。
    # systemctl restart dirsrv@instance_name
クライアントは、SyncRepl プロトコルを使用して、Directory Server とデータを同期できるようになりました。