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

    이 명령은 provider .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

    복제 상태마지막 업데이트 상태 필드를 확인합니다.

문제 해결

  1. 기본적으로 서버의 모든 계약에 대한 복제 유휴 타임아웃은 1시간입니다. 시간 초과로 인해 대규모 데이터베이스를 초기화하지 못하는 경우 nsslapd-idletimeout 매개변수를 더 높은 값으로 설정합니다. 예를 들어 매개변수를 7200 (2시간)으로 설정하려면 다음을 입력합니다.

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

    무제한 기간을 설정하려면 nsslapd-idletimeout0 으로 설정합니다.