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
# 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
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 使用--
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 <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
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
验证
显示协议状态:
dsconf <supplier2_instance_name> repl-agmt init-status --suffix "dc=example,dc=com" example-agreement-supplier2-to-supplier1
# dsconf <supplier2_instance_name> repl-agmt init-status --suffix "dc=example,dc=com" example-agreement-supplier2-to-supplier1 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 <supplier2_instance_name> config replace nsslapd-idletimeout=7200
# dsconf <supplier2_instance_name> config replace nsslapd-idletimeout=7200
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 要设置无限周期,请将
nsslapd-idletimeout
设置为0。