第19章 一般的なレプリケーションの問題解決
マルチサプライヤーレプリケーションは、最終的に調整されたレプリケーションモデルを使用します。つまり、同じエントリーを別のサーバーで変更できることを意味します。これらの 2 つのサーバー間でレプリケーションが発生すると、Directory Server は競合する変更を解決する必要があります。多くの場合は、各サーバーでの変更に関連するタイムスタンプに基づいて解決が自動的に行われます。最新の変更が優先されます。ただし、解像度に到達するには、競合を手動で介入する必要があるケースがあります。
19.1. 命名の競合特定および解決
異なるサーバーに同じ識別名 (DN) で 2 つのエントリーを作成すると、レプリケーション中に自動的に競合解決が行われ、DN のエントリーの一意識別子など、最後に作成されたエントリーの名前が変更されます。すべてのディレクトリーエントリーには、nsuniqueid
の操作属性に格納されている一意の識別子が含まれます。命名の競合が発生すると、レプリケーション手順ではこの一意の ID が一意でない DN に追加されます。
たとえば、2 つの異なるサーバーに uid=user_name,ou=People,dc=example,dc=com
エントリーが作成された場合、レプリケーションは一意の ID を、作成した最後のエントリーの DN に追加します。つまり、以下のエントリーが存在します。
-
uid=user_name,ou=People,dc=example,dc=com
-
nsuniqueid=a7f1758b-512211ec-b115e2e9-7dc2d46b+uid=user_name,ou=People,dc=example,dc=com
手順
競合エントリーをリスト表示します。
#
dsconf -D "cn=Directory Manager" ldap://server.example.com repl-conflict list dc=example,dc=com
dn: nsuniqueid=a7f1758b-512211ec-b115e2e9-7dc2d46b+uid=user_name,ou=people,dc=example,dc=com cn: user_name displayName: user gidNumber: 99998 homeDirectory: /var/empty legalName: user name loginShell: /bin/false nsds5replconflict: namingConflict (ADD) uid=user_name,ou=people,dc=example,dc=com objectClass: top objectClass: nsPerson objectClass: nsAccount objectClass: nsOrgPerson objectClass: posixAccount objectClass: ldapsubentry uid: user_name uidNumber: 99998この場合、Directory Server が最初のエントリーを複製する前に、ユーザーが異なるサーバー 2 台に手動で作成されました。
競合エントリーが存在する場合は、続行方法を決定します。
有効なエントリー (
uid=user_name,ou=People,dc=example,dc=com
) を維持し、競合エントリーを削除するには、次のコマンドを実行します。#
dsconf -D "cn=Directory Manager" ldap://server.example.com repl-conflict delete nsuniqueid=a7f1758b-512211ec-b115e2e9-7dc2d46b+uid=user_name,ou=People,dc=example,dc=com
競合エントリー (
nsuniqueid=a7f1758b-512211ec-b115e2e9-7dc2d46b+uid=user_name,ou=People,dc=example,dc=com
) のみを保持するには、次のコマンドを実行します。#
dsconf -D "cn=Directory Manager" ldap://server.example.com repl-conflict swap nsuniqueid=a7f1758b-512211ec-b115e2e9-7dc2d46b+uid=user_name,ou=People,dc=example,dc=com
両方のエントリーを保持するには、新しい相対識別名 (RDN) を指定して、競合エントリーの名前を変更します。
#
dsconf -D "cn=Directory Manager" ldap://server.example.com repl-conflict convert --new-rdn=uid=user_name_NEW nsuniqueid=a7f1758b-512211ec-b115e2e9-7dc2d46b+uid=user_name,ou=People,dc=example,dc=com
上記のコマンドは、競合エントリーの名前を
uid=user_name_NEW,ou=People,dc=example,dc=com
に変更します。