AppFabric 缓存 - 现有连接被远程主机强制关闭
我正在尝试在本地开发环境中启动并运行 AppFabric 缓存。我安装了 Windows Server AppFabric Beta 2 Refresh,并且配置了缓存群集和主机并开始在 Windows 7 64 位上运行。我在集成模式下的 v4.0 应用程序池下的本地 IIS 网站中运行我的 MVC2 网站。
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 黄色错误屏幕,其中显示以下内容:
现有连接被强行关闭远程主机
描述:执行当前 Web 请求期间发生未处理的异常。请查看堆栈跟踪以获取有关错误及其在代码中的来源的更多信息。
异常详细信息:System.Net.Sockets.SocketException:现有连接被远程主机强制关闭
源错误:
Line 21: protected CacheService()
Line 22: {
Line 23: _cacheFactory = new DataCacheFactory();
Line 24: _defaultCache = _cacheFactory.GetDefaultCache();
Line 25: }
I'm trying to get AppFabric cache up and running on my local development environment. I have Windows Server AppFabric Beta 2 Refresh installed, and the cache cluster and host configured and started running on Windows 7 64-bit. I'm running my MVC2 website in a local IIS website under a v4.0 app pool in integrated mode.
HostName : CachePort Service Name Service Status Version Info
-------------------- ------------ -------------- ------------
SN-3TQHQL1:22233 AppFabricCachingService UP 1 [1,1][1,1]
I have my web.config configured with the following:
<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>
I'm getting an error when I attempt to initialize the DataCacheFactory:
protected CacheService()
{
_cacheFactory = new DataCacheFactory(); <-- Error here
_defaultCache = _cacheFactory.GetDefaultCache();
}
I'm getting the ASP.NET yellow error screen with the following:
An existing connection was forcibly closed by the remote host
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Net.Sockets.SocketException: An existing connection was forcibly closed by the remote host
Source Error:
Line 21: protected CacheService()
Line 22: {
Line 23: _cacheFactory = new DataCacheFactory();
Line 24: _defaultCache = _cacheFactory.GetDefaultCache();
Line 25: }
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我也遇到了类似的问题,我的问题是我没有向缓存客户端授予适当的权限。为了快速验证这是问题所在,我将授予每个人帐户对缓存的访问权限。如果这解决了问题,那么请考虑限制对适当帐户而不是所有人的访问。这可以通过“缓存管理员 Windows PowerShell”执行以下命令来完成,该命令位于 Windows Server AppFabric 开始菜单文件夹中:
I had a similar issue as well, and my problem was I had not given the proper permissions to the cache client. In order to quickly verify this is the issue I would grant the everyone account access to the cache. If this fixes the issue then look into limiting access to the appropriate account rather than everyone. This can done executing the following command via the "Caching Administrator Windows PowerShell", which is found in the Windows Server AppFabric start menu folder:
我也遇到了这个问题,我在此线程中找到了答案:
http://social.msdn.microsoft.com/Forums/vstudio/en-US/c27063e7-1579-4d62-9104-87076d1c8d98/client-caching-error-errorcodeerrca0017substatuses0006
答案:
I had this problem too and I found the answer in this thread:
http://social.msdn.microsoft.com/Forums/vstudio/en-US/c27063e7-1579-4d62-9104-87076d1c8d98/client-caching-error-errorcodeerrca0017substatuses0006
The answer:
如果您使用 DataCacheFactoryConfiguration 对象,是否会遇到同样的问题?例如,
您是否在防火墙上打开了端口?
也许检查事件日志中的条目 - 它们可能会提供有关正在发生(或未发生)的事情的线索。
Do you get the same problem if you use a DataCacheFactoryConfiguration object? e.g.
Have you opened the port on your firewall?
Maybe check entries in your event logs - they may offer clues as to what is (or isn't) happening.