开发者

configuration setting for appfabric

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 = serv开发者_如何学JAVAers;

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


You may need to grant your AppPool's identity access to the cache server. This account needs to be granted access to the AppFabric cache for the client to work in ASP.NET. This also applies when you are using ASP.NET impersonation, the cache client will still use the AppPool's identity to authenticate the cache client, not the impersonated account.


If you are not using routing deployment="routing" should be removed.


Have you turn on the cluster service?

I've encountered this message before, and then I start the cache cluster by issueing Start-CacheCluster in powershell of Appfabric.

Afterwards, make sure it is on (you can do telnet to your "servername" on port 22233 (default port for cache port) and make sure it is connected (include this on firewall exception).

Hope it helps and still valid for your question :)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜