第17章 SyncRepl プロトコルを使用したコンテンツ同期の設定
Content Synchronization
プラグインを使用すると、Directory Server は RFC 4533 に従って SyncRepl
プロトコルをサポートします。このプロトコルにより、LDAP サーバーとクライアントは Red Hat Directory Server をソースとして使用し、ローカルデータベースを Directory Server の変更するコンテンツと同期させることができます。
SyncRepl
プロトコルを使用するには、以下を実行します。
- Directory Server で
Content Synchronization
プラグインを有効にし、必要に応じてクライアントが Directory Server にバインドするために使用する新規ユーザーを作成します。アカウントには、ディレクトリー内のコンテンツを読み取るパーミッションが必要です。 - クライアントを設定します。たとえば、同期するサブツリーの検索ベースを設定します。詳細は、クライアントのドキュメントを参照してください。
17.1. コマンドラインを使用した Content Synchronization
プラグインの設定
コマンドラインを使用して
Content Synchronization
プラグインを設定するには、以下を実行します。
Content Synchronization
プラグインでは、nsuniqueid
属性をログに記録するのにRetro Changelog
プラグインが必要です。- Retro Changelog が有効になっているかどうかを確認するには、次のコマンドを実行します。
# dsconf -D "cn=Directory Manager" ldap://server.example.com plugin retro-changelog show ... nsslapd-pluginEnabled: off
nsslapd-pluginEnabled
パラメーターが off に設定されている場合、Retro Changelog は無効になります。有効にする場合は、「Retro Changelog プラグインの有効化」を参照してください。 nsuniqueid
属性を、Retro Changelog プラグインの設定に追加します。# dsconf -D "cn=Directory Manager" ldap://server.example.com plugin retro-changelog set --attribute nsuniqueid:targetUniqueId
- 必要に応じて、パフォーマンスを向上させるために、以下の推奨事項を適用します。
- 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
- データを同期するバックエンドまたはサブツリーのクライアントアクセスを把握している場合は、
Retro Changelog
プラグインのスコープを制限します。たとえば、cn=demo,dc=example,dc=com
サブツリーを除外するには、以下を入力します。# dsconf -D "cn=Directory Manager" ldap://server.example.com plugin retro-changelog set --exclude-suffix "cn=demo,dc=example,dc=com"
Content Synchronization
プラグインを有効にします。# dsconf -D "cn=Directory Manager" ldap://server.example.com plugin set --enabled on "Content Synchronization"
- デフォルトの 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 の詳細は、「バインドルールの定義」を参照してください。 - Directory Server を再起動します。
# dsctl instance_name restart
クライアントは、
SyncRepl
プロトコルを使用して、Directory Server とデータを同期できるようになりました。