我在使用 2 个主机运行 AppFabric 集群时遇到问题。我已经验证它仅适用于 1 个主机(即,当我浏览 Web 应用程序时,缓存项数会增加),但是当我尝试将第二个主机加入集群时,我收到以下异常:
Failed to read remote registry key from host 289851-cache2:
Microsoft.ApplicationServer.Caching.DataCacheException:
ErrorCode<ERRCAdmin026>:SubStatus<ES0001>:Remote registry access failed on host 289851-cache2.
Check if the required permissions are available. ---> System.IO.IOException: The network path was not found.
at Microsoft.Win32.RegistryKey.Win32ErrorStatic(Int32 errorCode, String str)
at Microsoft.Win32.RegistryKey.OpenRemoteBaseKey(RegistryHive hKey, String machineName, RegistryView view)
at Microsoft.ApplicationServer.Caching.AdminApi.CacheAdmin.GetRemoteRegistryKey(String hostName, Boolean writable)
--- End of inner exception stack trace ---
at Microsoft.ApplicationServer.Caching.AdminApi.CacheAdmin.GetRemoteRegistryKey(String hostName, Boolean writable)
at Microsoft.ApplicationServer.Caching.AdminApi.CacheAdmin.GetServerVersion(String
hostName),DistributedCache.CacheAdmin,Error
其中 289851-cache2 是第二个主机的名称。
即使异常说检查权限,我已将缓存连接帐户更改为我的域帐户并在任何地方授予访问权限 - 该帐户是两台 AppFabric 主机上的管理员,具有对网络共享的完全访问权限,并且我运行 AppFabric PowerShell 作为管理员。但是在我运行 Start-CacheCluster 后,第一台主机的状态将为 UP,而第二台主机的状态为无限期启动。我需要重新启动机器才能执行任何其他操作,因为即使通过任务管理器或控制面板中的服务,它也不会让我停止、启动或终止进程。
我们正在运行安装了 WindowsServerAppFabricSetup_x64_6.0 的 Windows Server 2008 64 位(不是 6.1,因为我认为这需要 Windows Server 2008 R2),配置存储在网络共享上。
主机 1 的 DistributedCacheAgent.config:
<host replicationPort="22236" arbitrationPort="22235" clusterPort="22234" hostId="1739552749" size="1228" leadHost="true" account="<domain account>" name="localhost" cacheHostName="AppFabricCachingService" cachePort="22233" />
主机2的DistributedCacheAgent.config:
<host replicationPort="22236" arbitrationPort="22235" clusterPort="22234" hostId="1739552749" size="1228" leadHost="false" account="<domain account>" name="localhost" cacheHostName="AppFabricCachingService" cachePort="22233" />
提前致谢。