4

そのため、多くのユーザーが経験したのと同じエラーが発生しています-

> Home Page. Modify this template to jump-start your ASP.NET MVC
> application.Microsoft.ApplicationServer.Caching.DataCacheException:
> 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. For
> on-premises cache clusters, also verify the following conditions.
> Ensure that security permission has been granted for this client
> account, and check that the AppFabric Caching Service is allowed
> through the firewall on all cache hosts. Also the MaxBufferSize on the
> server must be greater than or equal to the serialized object size
> sent from the client.). Additional Information : The client was trying
> to communicate with the server:
> net.tcp://hamzacachetrial.cache.windows.net:24233. at
> Microsoft.ApplicationServer.Caching.DataCache.ThrowException(ErrStatus
> errStatus, Guid trackingId, Exception responseException, Byte[][]
> payload, EndpointID destination) at
> Microsoft.ApplicationServer.Caching.DataCache.ThrowException(ResponseBody
> respBody, EndpointID destination) at
> Microsoft.ApplicationServer.Caching.DataCacheFactory.EstablishConnection(IEnumerable`1
> servers, RequestBody request, Func`3 sendMessageDelegate,
> DataCacheReadyRetryPolicy retryPolicy) at
> Microsoft.ApplicationServer.Caching.SocketClientProtocol.<>c__DisplayClass5.<Initialize>b__2(RequestBody
> req) at
> Microsoft.ApplicationServer.Caching.SocketClientProtocol.SendReceive(IVelocityRequestPacket
> request, Func`2 delegate, EndpointID& destination) at
> Microsoft.ApplicationServer.Caching.SocketClientProtocol.Initialize(IEnumerable`1
> servers) at
> Microsoft.ApplicationServer.Caching.DataCacheFactory.GetCache(String
> cacheName, CreateNewCacheDelegate cacheCreationDelegate,
> DataCacheInitializationViaCopyDelegate initializeDelegate) at
> Microsoft.ApplicationServer.Caching.DataCacheFactory.GetCache(String
> cacheName) at MvcWebRole1.Controllers.HomeController.Index() in
> c:\Users\hk7654\Documents\Visual Studio
> 2012\Projects\CacheTrial\MvcWebRole1\Controllers\HomeController.cs:line
> 46

これは私の機能です-

`public ActionResult Index()
    {
        var retryStrategy = new FixedInterval(5, TimeSpan.FromSeconds(60));
        var retryPolicy = new RetryPolicy<CacheTransientErrorDetectionStrategy>(retryStrategy);
        DataCache cache = null;

        retryPolicy.Retrying += (sender1, args) =>
        {
            var msg = String.Format("Retry - Count:{0}, Delay:{1}, Exception:{2}",
                args.CurrentRetryCount, args.Delay, args.LastException);
            Trace.Write(msg);
        };

        try
        {
             DataCacheFactoryConfiguration config = new DataCacheFactoryConfiguration();
             config.TransportProperties.ReceiveTimeout = new TimeSpan(45000);
             config.ChannelOpenTimeout = new TimeSpan(150000);

             DataCacheFactory cacheFactory = new DataCacheFactory(config);
             cache = cacheFactory.GetCache("default");

             retryPolicy.ExecuteAction(
             () =>
                {
                    cache.Add("name" + _i++, "hamza");

                });

         }
         catch (DataCacheException ex)
         {
              Trace.Write(ex.GetType().ToString() +  ex.Message.ToString()+ex.StackTrace.ToString());
         }

    }`

いくつかのソリューションで言及されているように、Transient Fault Handling と ChannelOpenTimeout および TransportProperties.ReceiveTimeout を使用しました。これは、Web 構成の datacacheclient セクションです -

 <dataCacheClients>
<dataCacheClient name="default">

  <autoDiscover isEnabled="true" identifier="hamzacachetrial.cache.windows.net" />
  <securityProperties mode="Message" sslEnabled="false">
    <messageSecurity authorizationInfo="XXXXXXXXXX" />
  </securityProperties>
</dataCacheClient>

ここでも何も問題はないようです。

In-Role Caching を使用すると、そのような問題は発生しませんが、専用のキャッシュ サービスは機能しません。キャッシュは、基本的な 128 MB キャッシュでも試した標準 4 GB キャッシュです。もう 1 つ知っておく必要があるのは、ClientPerfCounters が必要かということです。多くの人がこれを尋ねていることは理解していますが、どの解決策も私にとってはうまくいきませんでした。助けてください!!!

4

0 に答える 0