1.2. 명령줄을 사용하여 기존 서버를 소비자에게 공급업체로 구성

provider .example.com 호스트를 준비하려면 다음을 수행해야합니다.

  • 접미사에 대한 복제를 활성화합니다.
  • 소비자에 대한 복제 계약을 만듭니다.
  • 소비자를 초기화합니다.

복제 토폴로지의 기존 공급 업체에 대해 이 절차를 수행하십시오.

사전 요구 사항

  • 소비자의 dc=example,dc=com 접미사에 대한 복제를 활성화했습니다.

절차

  1. dc=example,dc=com 접미사의 복제를 활성화합니다.

    # 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 "consumer.example.com" --port 389 --conn-protocol=LDAP --bind-dn "cn=replication manager,cn=config" --bind-passwd "password" --bind-method=SIMPLE --init example-agreement

    이 명령은 example-agreement 라는 복제 계약을 생성합니다. 복제 계약은 공급업체가 이 소비자에게 데이터를 연결하고 복제할 때 사용하는 소비자의 호스트 이름, 프로토콜 및 인증 정보와 같은 설정을 정의합니다.

    계약이 생성되면 Directory Server가 consumer.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
    Agreement successfully initialized.
  3. 복제 상태를 표시합니다.

    # dsconf -D "cn=Directory Manager" ldap://supplier.example.com repl-agmt status --suffix "dc=example,dc=com" example-agreement
    Status For Agreement: "example-agreement" (consumer.example.com:389)
    Replica Enabled: on
    Update In Progress: FALSE
    Last Update Start: 20210330075608Z
    Last Update End: 20210330075608Z
    Number Of Changes Sent: 1:3/0
    Number Of Changes Skipped: None
    Last Update Status: Error (0) Replica acquired successfully: Incremental update succeeded
    Last Init Start: 20210330074603Z
    Last Init End: 20210330074606Z
    Last Init Status: Error (0) Total update succeeded
    Reap Active: 0
    Replication Status: Not in Synchronization: supplier (6062d73c000000010000) consumer (Unavailable) 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://supplier.example.com config replace nsslapd-idletimeout=7200

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