3.3. 使用命令行将新服务器配置为现有服务器的供应商
要将新服务器 provider 2.example.com 做为供应商准备,请使用以下方法之一:
- 为后缀启用复制。
- 创建到现有服务器的复制协议。
警告
不要从新服务器初始化现有供应商。否则,新服务器上的空数据库会覆盖现有供应商上的数据库。
在现有供应商中应用以下流程:
- 创建到新服务器的复制协议。
- 初始化新服务器。
先决条件
-
您可以在新服务器上为
dc=example,dc=com后缀启用复制。 -
您为现有服务器上的
dc=example,dc=com后缀启用复制。 - 要加入的新服务器被成功初始化。
流程
将复制协议添加到现有实例:
# dsconf <supplier2_instance_name> repl-agmt create --suffix "dc=example,dc=com" --host "supplier1.example.com" --port 389 --conn-protocol LDAP --bind-dn "cn=replication manager,cn=config" --bind-passwd "password" --bind-method SIMPLE example-agreement-supplier2-to-supplier1使用--
init选项将复制协议添加到新实例:# dsconf <supplier1_instance_name> repl-agmt create --suffix "dc=example,dc=com" --host "supplier2.example.com" --port 389 --conn-protocol LDAP --bind-dn "cn=replication manager,cn=config" --bind-passwd "password" --bind-method SIMPLE --init example-agreement-supplier1-to-supplier2
验证
显示协议状态:
# dsconf <supplier2_instance_name> repl-agmt init-status --suffix "dc=example,dc=com" example-agreement-supplier2-to-supplier1 Agreement successfully initialized.显示复制状态:
# dsconf <supplier2_instance_name> repl-agmt status --suffix "dc=example,dc=com" example-agreement-supplier2-to-supplier1 Status For Agreement: ""example-agreement-supplier2-to-supplier1 (supplier1.example.com:389) Replica Enabled: on Update In Progress: FALSE Last Update Start: 20210331073540Z Last Update End: 20210331073540Z Number Of Changes Sent: 7:1/0 Number Of Changes Skipped: None Last Update Status: Error (0) Replica acquired successfully: Incremental update succeeded Last Init Start: 20210331073535Z Last Init End: 20210331073539Z Last Init Status: Error (0) Total update succeeded Reap Active: 0 Replication Status: Not in Synchronization: supplier (60642649000000070000) consumer (Unavailable) State (green) Reason (error (0) replica acquired successfully: incremental update succeeded) Replication Lag Time: Unavailable验证
Replication Status和Last Update Status字段。
故障排除
默认情况下,服务器上所有协议的复制闲置超时为 1 小时。如果因为超时而初始化大型数据库失败,请将
nsslapd-idletimeout参数设置为更高的值。例如,要将参数设置为7200(2 小时),请输入:# dsconf <supplier2_instance_name> config replace nsslapd-idletimeout=7200要设置无限周期,请将
nsslapd-idletimeout设置为0。