[技术分享] 关于 RMS 服务器的缓存
RMS 服务器的缓存分为两部分,一部分是每台 RMS 服务器的本地 Active Directory 缓存,包括了 Active Directory Global Catalog 的组成员的查询结果。除了每台 RMS 服务器的本地缓存外,还存在一个共享的数据库缓存,存在于 SQL 的 directory services 数据库中。 RMS 的 AD 缓存的目的是减少到 Global Catalog 的请求数,加快查询响应时间。
当一个用户请求一个 use license 时,RMS 服务器会从文档的 publish license 中 判断这个用户是否已经拥有了相应的权限。一般来说,用户请求的 use license 和文档的 publish license 中能够完全匹配。但有很多情况下,文档创建者把文档的权限设置为一个组,而非一个特定用户,这样 RMS 服务器就必须去验证该用户所隶属的组,来确定该用户是否隶属于这个组,RMS 服务器发送 LDAP 请求到 Global Catalog 来完成这个请求。
对于用户和组的查询,RMS 服务器会缓存以下 Active Directory 缓存。
- ProxyAddresses (SMTP e-mail addresses only)
- objectSID
- sidHistory
- memberOf (GUIDs of groups of which the user or group is a member)
RMS 的缓存是会过期的,默认情况下为 12 小时,如果您希望让您在 AD 中对用户的改动在 RMS 查询中立即生效,或者为了排查用户组扩展的问题, 您可以采取一下几个步骤,再禁用缓存。
Steps for turning off the RMS Active Directory Cache
==========================================
1. Open SQL Server Management Studio, Delete all Table values in DRMS_DirectoryServices_XXX
2. Open SQL server Management Studio. Open table “DRMS_ClusterPolices” from Database “DRMS_Config_xxxx”, Find the “UseDirectoryServicesCacheDatabase” and set its value to 0.
3. Add below registry entries.
Create a file then run it at all RMS servers, e.g. “DisableADCache.reg”, the content as below:
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\DRMS\1.0\DirectoryServices]
"MinGc"=dword:00000000
"MaxGc"=dword:00000000
"PrincipalCacheMax"=dword:00000000
"PrincipalCacheExpireMinutes"=dword:00000000
"GroupIDCacheMax"=dword:00000000
"GroupIDCacheExpireMinutes"=dword:00000000
"GroupMembershipCacheMax"=dword:00000000
"GroupMembershipCacheExpireMinutes"=dword:00000000
"ContactMembersofGroupCacheMax"=dword:00000000
"ContactMembersofGroupCacheExpireMinutes"=dword:00000000
4. Run command: “iisreset /noforce” on All RMS servers.
James Yi
Microsoft RMS Support Expert