1

I am getting error "ErrorCode:SubStatus:Error in client configuration file." while working with app fabric.

When I try to create the object, it breaks and throws the above mentioned error. DataCacheFactory dcf = new DataCacheFactory();

The config file is as follows:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<!--configSections must be the FIRST element -->
<configSections>

<!-- required to read the <dataCacheClient> element -->
<section name="dataCacheClient"
   type="Microsoft.Data.Caching.DataCacheClientSection,
   CacheBaseLibrary"
   allowLocation="true"
   allowDefinition="Everywhere"/>

<!-- required to read the <fabric> element, when present -->
<section name="fabric"
   type="System.Data.Fabric.Common.ConfigFile,
   FabricCommon"
   allowLocation="true"
   allowDefinition="Everywhere"/>
</configSections>

<!-- routing client -->
<dataCacheClient deployment="routing">

<hosts>
  <host
     name="servername"
     cachePort="22233"
     cacheHostName="DistributedCacheService"/>
</hosts>
</dataCacheClient>

<system.web>
<sessionState mode="Custom" customProvider="Velocity">
  <providers>
    <!-- specify the named cache for session data -->
    <add
      name="Velocity"
      type="Microsoft.Data.Caching.SessionStoreProvider"
      />
  </providers>
</sessionState>
</system.web>
</configuration>

Edit: If I use code to connect to AppFabric, it gives another error "ErrorCode:SubStatus: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.)"

Code:

DataCacheServerEndpoint[] servers = new DataCacheServerEndpoint[1];
servers[0] = new DataCacheServerEndpoint("servername", 22233);

// Setup the DataCacheFactory configuration.
DataCacheFactoryConfiguration factoryConfig = new DataCacheFactoryConfiguration();
factoryConfig.Servers = servers;

// Create a configured DataCacheFactory object.
DataCacheFactory mycacheFactory = new DataCacheFactory(factoryConfig);
4

3 回答 3

0

您可能需要授予 AppPool 对缓存服务器的身份访问权限。此帐户需要被授予对 AppFabric 缓存的访问权限,客户端才能在 ASP.NET 中工作。这也适用于您使用 ASP.NET 模拟时,缓存客户端仍将使用 AppPool 的身份来验证缓存客户端,而不是模拟帐户。

于 2010-10-27T00:29:16.637 回答
0

开启集群服务了吗?

我之前遇到过这个消息,然后我通过在 Appfabric 的 powershell 中发出 Start-CacheCluster 来启动缓存集群。

之后,确保它已打开(您可以在端口 22233(缓存端口的默认端口)上远程登录您的“服务器名称”并确保它已连接(包括防火墙例外)。

希望它对您的问题有所帮助并且仍然有效:)

于 2011-12-13T03:06:12.877 回答
0

如果你不使用路由deployment="routing"应该被删除。

于 2011-07-15T14:00:23.653 回答