5.3. 使用基于证书的身份验证配置多层次复制
在带有基于证书的身份验证的多层次复制环境中,副本使用证书互相验证。
前提条件
-
您可以在主机
server1.example.com
和server2.example.com
上设置基于证书的身份验证。 - 目录服务器信任发布客户端证书的证书颁发机构(CA)。
-
客户端证书满足服务器上的
/etc/dirsrv/slapd-instance_name/certmap.conf
中设置的要求。
流程
在
server1.example.com
上:删除临时复制协议:
dsconf <server1_instance_name> repl-agmt delete --suffix="dc=example,dc=com" temporary_agreement
# dsconf <server1_instance_name> repl-agmt delete --suffix="dc=example,dc=com" temporary_agreement
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 将
cn=repl_servers,dc=groups,dc=example,dc=com
绑定组添加到复制设置中:dsconf <server1_instance_name> replication set --suffix="dc=example,dc=com" --repl-bind-group "cn=repl_servers,dc=groups,dc=example,dc=com"
# dsconf <server1_instance_name> replication set --suffix="dc=example,dc=com" --repl-bind-group "cn=repl_servers,dc=groups,dc=example,dc=com"
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 配置目录服务器以自动检查 bind 组中的更改:
dsconf <server1_instance_name> replication set --suffix="dc=example,dc=com" --repl-bind-group-interval=0
# dsconf <server1_instance_name> replication set --suffix="dc=example,dc=com" --repl-bind-group-interval=0
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
在
server2.example.com
上:删除临时复制管理器帐户:
dsconf <server2_instance_name> replication delete-manager --suffix="dc=example,dc=com" --name="Replication Manager"
# dsconf <server2_instance_name> replication delete-manager --suffix="dc=example,dc=com" --name="Replication Manager"
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 将
cn=repl_servers,dc=groups,dc=example,dc=com
绑定组添加到复制设置中:dsconf <server2_instance_name> replication set --suffix="dc=example,dc=com" --repl-bind-group "cn=repl_servers,dc=groups,dc=example,dc=com"
# dsconf <server2_instance_name> replication set --suffix="dc=example,dc=com" --repl-bind-group "cn=repl_servers,dc=groups,dc=example,dc=com"
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 配置目录服务器以自动检查 bind 组中的更改:
dsconf <server2_instance_name> replication set --suffix="dc=example,dc=com" --repl-bind-group-interval=0
# dsconf <server2_instance_name> replication set --suffix="dc=example,dc=com" --repl-bind-group-interval=0
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 使用基于证书的身份验证创建复制协议:
dsconf <server2_instance_name> repl-agmt create --suffix="dc=example,dc=com" --host="server1.example.com" --port=636 --conn-protocol=LDAPS --bind-method="SSLCLIENTAUTH" --init server2-to-server1*
# dsconf <server2_instance_name> repl-agmt create --suffix="dc=example,dc=com" --host="server1.example.com" --port=636 --conn-protocol=LDAPS --bind-method="SSLCLIENTAUTH" --init server2-to-server1*
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
在
server1.example.com
上,使用基于证书的身份验证创建复制协议:dsconf <server1_instance_name> repl-agmt create --suffix="dc=example,dc=com" --host="server2.example.com" --port=636 --conn-protocol=LDAPS --bind-method="SSLCLIENTAUTH" --init server1-to-server2
# dsconf <server1_instance_name> repl-agmt create --suffix="dc=example,dc=com" --host="server2.example.com" --port=636 --conn-protocol=LDAPS --bind-method="SSLCLIENTAUTH" --init server1-to-server2
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
验证
验证每个服务器中初始化是否成功:
dsconf <server1_instance_name> repl-agmt init-status --suffix "dc=example,dc=com" server1-to-server2 dsconf <server2_instance_name> repl-agmt init-status --suffix "dc=example,dc=com" server2-to-server1
# dsconf <server1_instance_name> repl-agmt init-status --suffix "dc=example,dc=com" server1-to-server2 Agreement successfully initialized. # dsconf <server2_instance_name> repl-agmt init-status --suffix "dc=example,dc=com" server2-to-server1 Agreement successfully initialized.
Copy to Clipboard Copied! Toggle word wrap Toggle overflow