我已经在服务器上安装了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>

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

解析器错误消息:错误代码:替代:存在暂时的故障。请稍后重试。 (一个或多个指定的缓存服务器不可用,这可能是由繁忙的网络或服务器引起的。确保已在集群上授予该客户帐户的安全许可,并且通过所有缓存主机上的防火墙允许使用AppFabric Caching服务。稍后重试)

源错误:

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.care.care。

感谢您的时间和耐心

关于Gagan Janjua的问候

有帮助吗?

解决方案

您是否授予对网站运行的任何用户的访问权限?

Grant-CacheallowedClientAccount Gagan

其他提示

我也有这个错误。只是为了测试开发中的客户

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

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

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

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

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

new -cache -Cachename名称ofcacheasnetinwebconfig -timetolive 30
Grant-cacheallowedClientAccount“ IIS AppPool nameofapppoolrunningsite”

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

我解决了此问题如下:

启动Windows任务管理器,并注意您的w3wp.exe正在运行什么用户名?

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

启动开始 - >所有程序 - > Windows Server应用程序面料 - > IIS Manager

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

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

启动开始 - >所有程序 - > Windows Server应用程序面料 - >缓存管理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.)

我遇到了这个问题,只是在重新启动后,高速缓存群已经下降了。我没有意识到您必须手动切换服务才能在服务中自动启动。有关此的详细信息 这里.

在配置中评论以下内容为我修复了它:

<sessionState customProvider="AppFabricCacheSessionStoreProvider" mode="Custom" timeout="90">
  <providers>
    <add name="AppFabricCacheSessionStoreProvider" type="Microsoft.ApplicationServer.Caching.DataCacheSessionStoreProvider" cacheName="Session" sharedId="SharedApp" />
  </providers>
</sessionState>

默认情况下,工作过程将设置为IIS用户,这些用户需要访问。在你的 缓存管理Windows PowerShell 键入以下内容

Grant-cacheallowedClientAccount IIS_IUSRS

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top