【问题标题】:AppFabric 1.1 Caching (crashing windows service)AppFabric 1.1 缓存(崩溃的 windows 服务)
【发布时间】:2012-01-18 11:25:08
【问题描述】:

我在单台机器(域注册,Windows 7 企业版)上测试安装了 AppFabric 1.1 x64(主机 + 缓存)。安装和配置完美无缺(只有 1 台机器的集群,配置存储在 SQL 中),我在本地运行所有内容(包括 SQL Server 2008 R2)。当我想启动“AppFabric 缓存服务”时出现问题 - 它在几秒钟后崩溃,并且以下条目出现在管理事件中(在事件查看器中):

Faulting application name: DistributedCacheService.exe, version: 1.0.4632.0, time stamp: 0x4eafeccf
Faulting module name: KERNELBASE.dll, version: 6.1.7601.17651, time stamp: 0x4e21213c
Exception code: 0xe0434352
Fault offset: 0x000000000000cacd
Faulting process id: 0x1928
Faulting application start time: 0x01ccb8c5266c0fd5
Faulting application path: C:\Program Files\AppFabric 1.1 for Windows Server\DistributedCacheService.exe
Faulting module path: C:\Windows\system32\KERNELBASE.dll
Report Id: 6457890a-24b8-11e1-b051-70f1a19c8456

Application: DistributedCacheService.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.UriFormatException
Stack:
   at Microsoft.ApplicationServer.Caching.VelocityWindowsService.StartServiceCallback(System.Object)
   at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
   at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
   at System.Threading.ThreadPoolWorkQueue.Dispatch()
   at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback()

AppFabric Caching service crashed with exception {System.UriFormatException: Invalid URI: The hostname could not be parsed.
   at System.Uri.CreateThis(String uri, Boolean dontEscape, UriKind uriKind)
   at Microsoft.ApplicationServer.Caching.ServiceConfigurationManager.InitializeThisHostData()
   at Microsoft.ApplicationServer.Caching.ServiceConfigurationManager.InitializeDataFromGlobalConfig()
   at Microsoft.ApplicationServer.Caching.VelocityWindowsService.StartService(Boolean deleteTKT)
   at Microsoft.ApplicationServer.Caching.VelocityWindowsService.StartServiceCallback(Object context)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
   at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
   at System.Threading.ThreadPoolWorkQueue.Dispatch()
   at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback()}. Check debug log for more information

这是基本 PowerShell 命令的输出:

获取缓存主机

HostName : CachePort Service Name            Service Status Version Info
-------------------- ------------            -------------- ------------
MW7GM0B50ROMDQ:22233 AppFabricCachingService DOWN           3 [3,3][1,3]

Get-CacheHostConfig

cmdlet Get-CacheHostConfig at command pipeline position 1
Supply values for the following parameters:
HostName: MW7GM0B50ROMDQ
CachePort: 22233

HostName        : MW7GM0B50ROMDQ
ClusterPort     : 22234
CachePort       : 22233
ArbitrationPort : 22235
ReplicationPort : 22236
Size            : 3994 MB
ServiceName     : AppFabricCachingService
HighWatermark   : 99%
LowWatermark    : 90%
IsLeadHost      : True

缓存服务设置为作为网络服务运行。

您知道可能出了什么问题吗?我已经看到 “无效的 URI:无法解析主机名。” 消息,但配置中的名称似乎完全没问题(即使它看起来很奇怪,它也是我计算机的正确名称)。任何帮助将不胜感激。

附:我之前有 AppFabric 1.0,它似乎工作正常。我在安装 AppFabric 1.1 之前已将其卸载。

【问题讨论】:

    标签: .net caching appfabric


    【解决方案1】:

    我遇到了类似/相同的问题,但修复 HOST 并没有帮助。我的问题的核心是我的服务器名称很长(8 个以上字符)。配置缓存的时候剪掉了。

    第一个有用的提示是Get-CacheHost 输出,其中名称不正确。然后解决方案很简单:

    1. Export-CacheClusterConfig -Path <path>\config.xml
    2. 编辑文件并修正您的主机名
    3. Import-CacheClusterConfig -Path <path>\config.xml
    4. Start-CacheCluster

    【讨论】:

    • 就我而言,我的台式计算机已移至另一个域。该修复与主机名相同是一个 dns 名称。
    【解决方案2】:

    我已经设法找出原因。

    在我的 Windows 主机文件中,我有几个环回 IP 条目:localhost、{machine name} 和 {machine name FQDN}。当我删除除 {machine name FQDN} 之外的所有内容时,配置向导能够设置正确的配置。

    这是简单的方法,但我后来才知道......

    我解决问题的第一个(也是更痛苦的)方法是手动删除缓存服务配置并使用 PowerShell cmdlet 从头开始​​重新创建它:

    Import-Module ApplicationServer
    Import-Module DistributedCacheAdministration
    Import-Module DistributedCacheConfiguration
    New-CacheCluster ...
    Register-CacheHost ...
    Add-CacheHost ...
    Add-CacheAdmin ...
    etc.
    

    服务正常启动,但遗憾的是,当我使用 Get-CacheHost 验证设置时,我收到:

    HostName : CachePort                       Service Name            Service Status Version Info
    --------------------                       ------------            -------------- ------------
    MW7GM0B50ROMDQ.<domain part>:22233         AppFabricCachingService UP             0 [0,0][0,0]
    

    如果您查看版本号,您会发现它很可能不合适。不幸的是,当我尝试手动更新此信息(“Update-CacheHostAllowedVersions”)时,我得到了奇怪的“拒绝访问”错误:

    Update-CacheHostAllowedVersions : ErrorCode<ERRCAdmin026>:SubStatus<ES0001>:Remote registry access failed on host MW7GM0B50ROMDQ.<domain part>. Check if the required permissions are available and the host is not down.
    

    我必须做更多的测试来确定这是否真的是一个问题或只是一个烦恼。

    【讨论】:

    • 我已经设法设置了正确的版本信息,但是......遗憾的是,客户端连接会导致 AppFabric 缓存服务崩溃并带有一条有趣的评论:“无效的枚举值 'AdditionalRoutingProps' 不能反序列化为类型' Microsoft.ApplicationServer.Caching.NamedCacheProperty'"。我已经向微软提出了这个问题,也许他们能提供帮助。
    • 问题已解决。 GAC 中的 AppFabric 的 DLL 仍然是安装在 1.0 发行版中的那些。只能在 Program Files 的 AppFabric 目录中找到 1.1 DLL(或您选择安装它的任何位置)。总结一下——我(不是故意的)试图用 1.0 客户端访问 1.1 服务器。更新项目中的引用后,一切正常。
    • 谢谢!这救了我,从 HOSTS 文件中删除一个条目解决了我的问题。我有一个只有 {machinename} 的条目,一旦删除,一切都开始工作了。
    猜你喜欢
    • 2011-08-28
    • 1970-01-01
    • 2011-12-24
    • 2011-09-27
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多