搜索

6.4. 使用命令行将 hub 服务器配置为消费者的供应商

download PDF

要准备 hub,您需要:

  • 创建到消费者的复制协议。
  • 初始化消费者。

在复制拓扑的 hub 上执行这个步骤。

前提条件

  • hub 被初始化,从供应商复制到 hub 可以正常工作。
  • 您在 hub 上为 dc=example,dc=com 后缀启用复制。

流程

  • 添加复制协议并初始化消费者:

    # dsconf -D "cn=Directory Manager" ldap://hub.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-hub-to-consumer

    此命令创建一个名为 example-agreement-hub-to-consumer 的复制协议。复制协议定义设置,如消费者的主机名、协议和身份验证信息,如供应商在将数据连接和复制到此消费者时使用的身份验证信息。

    创建协议后,目录服务器会初始化 consumer.example.com。根据要复制的数据量,初始化可能会非常耗时。

验证

  1. 验证初始化是否成功:

    # dsconf -D "cn=Directory Manager" ldap://hub.example.com repl-agmt init-status --suffix "dc=example,dc=com" example-agreement-hub-to-consumer
    Agreement successfully initialized.
  2. 显示复制状态:

    # dsconf -D "cn=Directory Manager" ldap://hub.example.com repl-agmt status --suffix "dc=example,dc=com" example-agreement-hub-to-consumer
    Status For Agreement: "example-agreement-hub-to-consumer" (consumer.example.com:389)
    Replica Enabled: on
    Update In Progress: FALSE
    Last Update Start: 20210331131534Z
    Last Update End: 20210331131534Z
    Number Of Changes Sent: 0
    Number Of Changes Skipped: None
    Last Update Status: Error (0) Replica acquired successfully: Incremental update succeeded
    Last Init Start: 20210331131530Z
    Last Init End: 20210331131533Z
    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 StatusLast Update Status 字段。

故障排除

  1. 默认情况下,服务器上所有协议的复制闲置超时为 1 小时。如果因为超时而导致大型数据库的初始化失败,请将 nsslapd-idletimeout 参数设置为更高的值。例如,要将参数设置为 7200 (2 小时),请输入:

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

    要设置无限周期,请将 nsslapd-idletimeout 设置为 0。

Red Hat logoGithubRedditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

© 2024 Red Hat, Inc.