【发布时间】:2014-07-08 15:38:53
【问题描述】:
我一直在努力让 在 Azure 中发挥作用,共同定位缓存(非专用)。
在我的 MVC WebApi 2 项目的 web.config:
<configSections>
<section name="dataCacheClients" type="Microsoft.ApplicationServer.Caching.DataCacheClientsSection, Microsoft.ApplicationServer.Caching.Core" allowLocation="true" allowDefinition="Everywhere" />
</configSections>
...
<dataCacheClients>
<dataCacheClient name="default" isCompressionEnabled="true">
<autoDiscover isEnabled="true" identifier="MyWebApiProject" />
<clientNotification pollInterval="300" />
<transportProperties maxBufferSize="1073741824" maxBufferPoolSize="1073741824"/>
</dataCacheClient>
</dataCacheClients>
角色的缓存属性设置:
我在 Azure 中抛出了以下异常:
Microsoft.ApplicationServer.Caching.DataCacheException: 错误代码:子状态:暂时失败。 请稍后重试。 (一个或多个指定的缓存服务器是 不可用,这可能是由于网络或服务器繁忙造成的。为了 本地缓存集群,还要验证以下条件。 确保已为此客户端授予安全权限 帐户,并检查是否允许 AppFabric 缓存服务 通过所有缓存主机上的防火墙。还有 MaxBufferSize 服务器必须大于或等于序列化对象大小 从客户端发送。)。附加信息:客户正在尝试 与服务器通信:net.tcp://MyWebApiProject:24233。
当我关闭autoDiscover 时,像这样:
<autoDiscover isEnabled="false" identifier="MyWebApiProject" />
然后我得到一个不同的异常:
Microsoft.ApplicationServer.Caching.DataCacheException: ErrorCode:SubStatus:Server 集合不能 空。
使用 Compute Emulator 在本地运行时没有任何问题。
【问题讨论】:
标签: azure azure-web-roles appfabric azure-caching appfabric-cache