11

我已经在服务器上安装了 AppFabric。我已经创建了单台计算机的集群。我还创建了一个名为“Gagan”的缓存。按顺序使用以下命令

使用-CacheCluster -Provider xml -ConnectionString \NB-GJANJUA\Cache Start-CacheCluster

结果是缓存服务启动并运行..到目前为止一切顺利。

然后我设置我的 web.config 文件,如下所示

<?xml version="1.0"?>
<configuration>
    <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>

<!-- cache client -->
<dataCacheClient>
<!-- cache host(s) -->

<hosts>
  <host
     name="NB-GJANJUA.com"
     cachePort="22233"/>
</hosts>
</dataCacheClient>

<system.web>    

<compilation debug="true" targetFramework="4.0" >
    <assemblies>
      <add assembly="System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
      <add assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
      <add assembly="System.Data.DataSetExtensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
      <add assembly="System.Xml.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
      <add assembly="Microsoft.ApplicationServer.Caching.Client, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
      <add assembly="Microsoft.ApplicationServer.Caching.Core, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
    </assemblies>
</compilation>

<sessionState mode="Custom" customProvider="SessionStore" cookieless="true">
  <providers>
    <add name="SessionStore" type="Microsoft.ApplicationServer.Caching.DataCacheSessionStoreProvider" cacheName="Gagan" />
  </providers>
</sessionState>
</system.web>

<system.webServer>
 <modules runAllManagedModulesForAllRequests="true"/>
</system.webServer>
</configuration>

但是一旦我启动我的网站,它就会出现这个错误

解析器错误消息:ErrorCode:SubStatus:暂时失败。请稍后重试。(一个或多个指定的缓存服务器不可用,这可能是由于网络或服务器繁忙造成的。确保已为集群上的此客户端帐户授予安全权限,并且允许 AppFabric 缓存服务通过所有缓存主机上的防火墙。稍后重试。)

源错误:

Line 44:     <sessionState mode="Custom" customProvider="SessionStore" cookieless="true">
Line 45:       <providers>
Line 46:         <add name="SessionStore" type="Microsoft.ApplicationServer.Caching.DataCacheSessionStoreProvider" cacheName="Gagan" />
Line 47:       </providers>
Line 48:     </sessionState>

有什么我想念的吗?

注意:我已经引用了 Microsoft.ApplicationServer.Caching.Client 和 Microsoft.APplicationServer.Caching.Core 程序集

感谢您的时间和耐心

问候 Gagan Janjua

4

7 回答 7

10

我也有这个错误。只是为了测试开发中的客户端,我使用 AppFabric Power Shell 命令关闭了安全性

   Stop-CacheCluster
   Set-CacheClusterSecurity -SecurityMode None -ProtectionLevel None
   Start-CacheCluster

还在 web.config 的客户端应用程序中设置以下内容

   <dataCacheClient>
     <securityProperties mode="None" protectionLevel="None"/>
   </dataCacheClient>

这不是生产场景,但应用这些设置时上述错误消失。

于 2012-12-01T10:18:59.263 回答
5

我遇到了类似的问题,在 Windows Server 2008 R2 上运行 IIS 7.5。我通过在 PowerShell 中发出以下命令来解决它(从“开始”、“所有程序”中的 Windows AppFabric 文件夹开始):

New-Cache -CacheName NameOfCacheAsSetInWebConfig -TimeToLive 30  
Grant-CacheAllowedClientAccount "IIS AppPool\NameOfAppPoolRunningSite"

一旦我这样做了,我就准备好了。

于 2011-08-22T18:16:50.753 回答
4

您是否为您的网站运行的任何用户授予了访问缓存的权限?

Grant-CacheAllowedClientAccount Gagan

于 2010-10-12T00:49:28.637 回答
3

我解决了这个问题如下:

启动 Windows 任务管理器并注意您的 w3wp.exe 在哪个用户名下运行?

就我而言,它是:ASP.NET v4.0

启动开始 -> 所有程序 -> Windows Server App Fabric -> IIS 管理器

在 IIS 中,选择机器名称,然后选择左上角的应用程序池。

在应用程序池中..验证应用程序池下是否存在 ASP.net v4.0。

启动开始 -> 所有程序 -> Windows Server App Fabric -> 缓存管理 Windows Power Shell

在提示符下键入以下命令:Grant-CacheAllowedClientAccount "ASP.NET v4.0"

重新启动 Web 应用程序,以下错误消失了:

ErrorCode<ERRCA0017>:SubStatus<ES0006>:There is a temporary failure. Please retry later. (One or more specified Cache servers are unavailable, which could be caused by busy network or servers. Ensure that security permission has been granted for this client account on the cluster and that the AppFabric Caching Service is allowed through the firewall on all cache hosts. Retry later.)
于 2012-11-08T20:05:38.337 回答
1

我遇到了这个问题,只是缓存集群在重新启动后关闭了。我没有意识到您必须手动切换服务才能在服务中自动启动。详细信息在这里

于 2012-01-05T13:53:48.677 回答
1

在配置中注释掉以下内容为我修复了它:

<sessionState customProvider="AppFabricCacheSessionStoreProvider" mode="Custom" timeout="90">
  <providers>
    <add name="AppFabricCacheSessionStoreProvider" type="Microsoft.ApplicationServer.Caching.DataCacheSessionStoreProvider" cacheName="Session" sharedId="SharedApp" />
  </providers>
</sessionState>
于 2013-01-09T16:37:54.983 回答
0

默认情况下,工作进程将设置为 iis 用户,这些用户需要访问权限。在您的缓存管理 Windows Powershell中键入以下内容

Grant-CacheAllowedClientAccount IIS_IUSRS

于 2014-04-03T16:37:38.703 回答