2010-05-13 68 views
7

我试图让我的本地开发环境中运行AppFabric缓存。我有安装了Windows Server AppFabric Beta 2 Refresh,并且配置了缓存群集和主机,并开始在Windows 7 64位上运行。我在集成模式下的v4.0应用程序池下在本地IIS网站上运行我的MVC2网站。AppFabric缓存 - 现有连接被远程主机强制关闭

HostName : CachePort  Service Name   Service Status Version Info 
--------------------  ------------   -------------- ------------ 
SN-3TQHQL1:22233   AppFabricCachingService UP    1 [1,1][1,1] 

我已经配置了以下我的web.config:

<configSections> 
     <section name="dataCacheClient" type="Microsoft.ApplicationServer.Caching.DataCacheClientSection, Microsoft.ApplicationServer.Caching.Core, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" allowLocation="true" allowDefinition="Everywhere"/> 
    </configSections> 

    <dataCacheClient> 
     <hosts> 
      <host name="SN-3TQHQL1" cachePort="22233" /> 
     </hosts> 
    </dataCacheClient> 

我得到一个错误,当我尝试初始化DataCacheFactory:

protected CacheService() 
    { 
     _cacheFactory = new DataCacheFactory(); <-- Error here 
     _defaultCache = _cacheFactory.GetDefaultCache(); 
    } 

我越来越带有以下内容的ASP.NET黄色错误屏幕:

an exi sting连接被远程主机强制关闭

说明:执行当前Web请求期间发生未处理的异常。请查看堆栈跟踪以获取有关该错误的更多信息以及源代码的位置。

异常详细信息:System.Net.Sockets.SocketException:一个现有的连接被强行关闭远程主机

源错误:

Line 21:   protected CacheService() 
Line 22:   { 
Line 23:    _cacheFactory = new DataCacheFactory(); 
Line 24:    _defaultCache = _cacheFactory.GetDefaultCache(); 
Line 25:   } 
+0

,真正的问题是,如果您的帐户没有访问权限,你为什么不服务器告诉你,插件“一个现有的连接被远程主机强行关闭” – felickz 2013-07-01 14:53:06

回答

14

我也有类似的问题,我的问题是我没有给予缓存客户端的适当权限。为了快速验证这是问题,我将授予每个人帐户访问缓存。如果解决了这个问题,那就考虑限制访问适当的帐户而不是每个人。这可以做到通过“高速缓存管理器的Windows PowerShell”,这是在将Windows Server AppFabric中发现执行以下命令开始菜单文件夹:

Grant-CacheAllowedClientAccount everyone 
+0

谢谢!我一直试图弄清楚这一点,你是一个救生员。 – 2010-05-26 13:45:04

+1

这是一种懒惰的方式来做到这一点。更准确的解决方案是: Grant-CacheAllowedClientAccount“IIS AppPool \ AppPoolOfYourApplicationAccessingTheCache” – 2013-05-16 16:37:24

1

做,如果你使用DataCacheFactoryConfiguration你得到了同样的问题目的?例如

protected CacheService() 
{ 
    DataCacheFactoryConfiguration config; 
    List<DataCacheServerEndpoint> endpoints; 
    DataCacheFactory factory; 
    DataCache cache; 

    endpoints = new List<DataCacheServerEndpoint>(); 
    endpoints.Add(new DataCacheServerEndpoint("SN-3TQHQL1",22233)); 

    config = new DataCacheFactoryConfiguration(); 
    config.Servers = endpoints; 

    factory = new DataCacheFactory(config); 

    cache = factory.GetDefaultCache(); 
    ... 
} 

您是否在防火墙上打开过端口?

也许检查您的事件日志中的条目 - 他们可能会提供有关(或不)发生的线索。

+0

是的,我也试过这个。我尽可能地完成了所有配置,并且似乎都已正确配置。 +1 – 2010-05-14 21:07:20

+0

@Wallace不确定。尝试重新安装也许? – PhilPursglove 2010-05-14 21:26:29

+0

重新安装也没有工作。我目前正在与微软联系,试图解决这个问题。一旦我收到回复,我会发布回复。 – 2010-05-18 13:42:54

2

我也有这个问题,我发现在这个线程的答案:

http://social.msdn.microsoft.com/Forums/vstudio/en-US/c27063e7-1579-4d62-9104-87076d1c8d98/client-caching-error-errorcodeerrca0017substatuses0006

答案:

You are seeing this error because of the security property mismatch between client and server.

In your client code you disabled the security (Mode=None and PotectionLevel=None) whereas the cache server uses mode=Transport and PotectionLevel=EncryptAndSign (default in Beta2Fresh bits).

Do either of the following:

1) In the client code use the default security i.e. configuration.SecurityProperties =new DataCacheSecurity();

2) Disable the security at server to match with your existing client code. Use Powershell cmdlet Set-CacheClusterSecurity -SecurityMode None -ProtectionLevel None

+0

这对我有用。非常感谢您节省我的时间! – 2014-07-15 10:46:52

相关问题