1.2. 使用命令行将现有服务器配置为消费者的供应商
				要准备 vendor .example.com 主机,您需要:
			
- 为后缀启用复制。
 - 创建对消费者的复制协议。
 - 初始化使用者。
 
在复制拓扑中的现有供应商上执行这个步骤。
先决条件
- 
						在消费者中为 
dc=example,dc=com后缀启用复制。 
流程
为
dc=example,dc=com后缀启用复制:dsconf <supplier_instance_name> replication enable --suffix "dc=example,dc=com" --role "supplier" --replica-id 1
# dsconf <supplier_instance_name> replication enable --suffix "dc=example,dc=com" --role "supplier" --replica-id 1Copy to Clipboard Copied! Toggle word wrap Toggle overflow 此命令将 provider.
example.com主机配置为dc=example,dc=com后缀的供应商,并将此条目的副本 ID 设置为1。重要副本 ID 必须是拓扑中所有供应商的后缀
1到65534之间的唯一整数。添加复制协议并初始化消费者:
dsconf <supplier_instance_name> 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
# dsconf <supplier_instance_name> 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-agreementCopy to Clipboard Copied! Toggle word wrap Toggle overflow 此命令创建一个名为
example-agreement的复制协议。复制协议定义设置,如消费者的主机名、协议和身份验证信息,供供应商在连接和复制数据到此消费者时使用。创建协议后,目录服务器将初始化
consumer.example.com。根据要复制的数据量,初始化过程可能会非常耗时。
验证
显示复制配置:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 这些参数表示:
- 
								
nsDS5ReplicaRoot设置复制的后缀。 - 
								
nsDS5ReplicaType设置为3定义此主机是一个供应商。 
- 
								
 验证初始化是否成功:
dsconf <supplier_instance_name> repl-agmt init-status --suffix "dc=example,dc=com" example-agreement
# dsconf <supplier_instance_name> repl-agmt init-status --suffix "dc=example,dc=com" example-agreement Agreement successfully initialized.Copy to Clipboard Copied! Toggle word wrap Toggle overflow 显示复制状态:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 验证
Replication Status和Last Update Status字段。
故障排除
默认情况下,服务器上所有协议的复制闲置超时为 1 小时。如果因为超时而初始化大型数据库失败,请将
nsslapd-idletimeout参数设置为更高的值。例如,要将参数设置为7200(2 小时),请输入:dsconf<supplier_instance_name> config replace nsslapd-idletimeout=7200
# dsconf<supplier_instance_name> config replace nsslapd-idletimeout=7200Copy to Clipboard Copied! Toggle word wrap Toggle overflow 要设置无限周期,请将
nsslapd-idletimeout设置为0。