6.2. コマンドラインを使用した、既存サーバーのハブサーバーに対するサプライヤーとしての設定

既存のサーバーをサプライヤーとして準備するには、以下を行う必要があります。

  • 接尾辞のレプリケーションを有効にします。
  • ハブへのレプリカ合意を作成します。
  • ハブを初期化します。

レプリケーショントポロジーの既存のサプライヤーでこの手順を実行します。

前提条件

  • 参加するハブで dc=example,dc=com 接尾辞のレプリケーションを有効にしている。

手順

  1. dc=example,dc=com 接尾辞のレプリケーションを有効にします。

    # [command]`dsconf -D "cn=Directory Manager" ldap://supplier.example.com replication enable --suffix "dc=example,dc=com" --role "supplier" --replica-id 1

    このコマンドは、supplier.example.com ホストを dc=example,dc=com 接尾辞のサプライヤーとして設定し、このエントリーのレプリカ ID を 1 に設定します。

    重要

    トポロジー内のすべてのサプライヤーの接尾辞については、レプリカ ID は 1 から 65534 の間の一意の整数である必要があります。

  2. レプリカ合意を追加し、新規サーバーを初期化します。

    # dsconf -D "cn=Directory Manager" ldap://supplier.example.com repl-agmt create --suffix "dc=example,dc=com" --host "hub.example.com" --port 389 --conn-protocol LDAP --bind-dn "cn=replication manager,cn=config" --bind-passwd "password" --bind-method SIMPLE --init example-agreement-supplier-to-hub

    このコマンドは、example-agreement-supplier-to-hub という名前のレプリカ合意を作成します。レプリカ合意は、ハブのホスト名、プロトコル、ハブへのデータの接続や複製時にサプライヤーが使用する認証情報などの設定を定義します。

    この合意の作成後、Directory Server は hub.example.com を初期化します。複製するデータ量によっては、初期化に時間がかかる場合があります。

検証

  1. レプリケーション設定を表示します。

    # dsconf -D "cn=Directory Manager" ldap://supplier.example.com replication get --suffix "dc=example,dc=com"
    dn: cn=replica,cn=dc\3Dexample\2Cdc\3Dcom,cn=mapping tree,cn=config
    ...
    nsDS5ReplicaRoot: dc=example,dc=com
    nsDS5ReplicaType: 3
    ...

    これらのパラメーターは以下を示しています。

    • nsDS5ReplicaRoot は、レプリケートされる接尾辞を設定します。
    • nsDS5ReplicaType3 に設定して、このホストがサプライヤーであることを定義します。
  2. 初期化が成功したかどうかを確認します。

    # dsconf -D "cn=Directory Manager" ldap://supplier.example.com repl-agmt init-status --suffix "dc=example,dc=com" example-agreement-supplier-to-hub
    Agreement successfully initialized.
  3. レプリケーションのステータスを表示します。

    # dsconf -D "cn=Directory Manager" ldap://supplier.example.com repl-agmt status --suffix "dc=example,dc=com" example-agreement-supplier-to-hub
    Status For Agreement: "example-agreement-supplier-to-hub" (hub.example.com:389)
    Replica Enabled: on
    Update In Progress: FALSE
    Last Update Start: 20210331105030Z
    Last Update End: 20210331105030Z
    Number Of Changes Sent: 0
    Number Of Changes Skipped: None
    Last Update Status: Error (0) Replica acquired successfully: Incremental update succeeded
    Last Init Start: 20210331105026Z
    Last Init End: 20210331105029Z
    Last Init Status: Error (0) Total update succeeded
    Reap Active: 0
    Replication Status: Not in Synchronization: supplier (Unknown) consumer (Unknown) State (green) Reason (error (0) replica acquired successfully: incremental update succeeded)
    Replication Lag Time: Unavailable

    Replication Status フィールドおよび Last Update Status フィールドを確認します。

トラブルシューティング

  1. デフォルトでは、サーバー上のすべての合意に対するレプリケーションアイドルタイムアウトは 1 時間です。タイムアウトが原因で大規模なデータベースの初期化が失敗する場合は、nsslapd-idletimeout パラメーターをより高い値に設定します。たとえば、パラメーターを 7200(2 時間) に設定するには、次のコマンドを実行します。

    # dsconf -D "cn=Directory Manager" ldap://supplier1.example.com config replace nsslapd-idletimeout=7200

    無制限の期間を設定するには、nsslapd-idletimeout0 に設定します。