16.3. 防止部分复制中的空更新
部分复制不包括来自复制更新的属性(nsDS5ReplicatedAttributeList
,nsDS5ReplicatedAttributeListTotal
)。但是,对 exclude 属性的更改仍然会触发修改事件并生成空复制更新。
要防止空的更新,请使用 nsds5ReplicaStripAttrs
参数,它添加了目录服务器不在空复制事件中发送的属性列表,并从更新序列中删除。这种逻辑上必须包括诸如 modifiersName
等操作属性。如果复制事件不为空,目录服务器仍然会在其他更改中复制剥离的属性。
例如,您从复制中排除 accountUnlockTime
属性。对于锁定的用户,当 accountUnlockTime
中设置的时间周期过期时,Directory 服务器会自动解锁用户。只有 accountUnlockTime
属性已更改,并且该属性不包括在复制中。但是,这个解锁事件也会更改 operational 属性 internalmodifytimestamp
。这会触发复制事件,因为用户帐户被修改。但是,要复制的唯一数据是新的修改时间戳,否则更新为空。如果您有大量与登录时间或密码过期时间相关的属性,这可能会造成很多空复制更新,对服务器性能造成负面影响或干扰相关的应用程序。
以下流程剥离不必要的属性,以防止空的更新。
先决条件
-
您复制
dc=example,dc=com
后缀,并且存在复制协议example_agreement
。
流程
使用
dsconf
工具来调优部分复制:dsconf <instance_name> repl-agmt set example_agreement \ --suffix="dc=example,dc=com" --strip-list="modifiersname \ modifytimestamp internalmodifiersname"
# dsconf <instance_name> repl-agmt set example_agreement \ --suffix="dc=example,dc=com" --strip-list="modifiersname \ modifytimestamp internalmodifiersname" Successfully updated agreement
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
验证
查看复制协议设置:
dsconf <instance_name> repl-agmt list --suffix=dc=example,dc=com | grep -i nsds5ReplicaStripAttrs
# dsconf <instance_name> repl-agmt list --suffix=dc=example,dc=com | grep -i nsds5ReplicaStripAttrs nsds5ReplicaStripAttrs: modifiersname modifytimestamp internalmodifiersname
Copy to Clipboard Copied! Toggle word wrap Toggle overflow