简体   繁体   English

尝试将会话存储在同一位置的Azure缓存中时,为什么我的实例会回收?

[英]Why do my instances recycle when trying to store sessions in co-located Azure cache?

I run an ASP.Net MVC3 application and have followed this Windows Azure How-To on how to store my sessions in a co-located cache in Windows Azure. 我运行ASP.Net MVC3应用程序,并已遵循此Windows Azure操作方法 ,了解如何将会话存储在Windows Azure中的同一位置的缓存中。

I have installed the mentioned Nuget-package, and applied the necessary information to my web.config. 我已经安装了提到的Nuget软件包,并将必要的信息应用于我的web.config。 The web role is setup to run 2 small instances, and use a 30% co-located cache. Web角色设置为运行2个小型实例,并使用30%的托管缓存。

When I deploy to Azure, my instances just recycle. 当我部署到Azure时,我的实例只是回收。 Through a remote desktop connection to one of the instances, I have found these two events in the logs, that seem related: 通过与实例之一的远程桌面连接,我在日志中发现了这两个似乎相关的事件:

The CacheStatusIndicator service terminated unexpectedly. CacheStatusIndicator服务意外终止。 It has done this 1 time(s). 它已经完成了1次。 The following corrective action will be taken in 1000 milliseconds: Restart the service. 在1000毫秒内将采取以下纠正措施:重新启动服务。

The CacheService service terminated unexpectedly. CacheService服务意外终止。 It has done this 1 time(s). 它已经完成了1次。 The following corrective action will be taken in 60000 milliseconds: Restart the service. 将在60000毫秒内采取以下纠正措施:重新启动服务。

However, I cannot find much information on that. 但是,我在这方面找不到太多信息。

Does anyone have a clue what I might be missing here? 有人知道我在这里可能会缺少什么吗?

I am very much sure that your role is missing some of the reference and because of that your see such message from CacheStatusIndicator. 我非常确定您的角色缺少某些参考,因此您会从CacheStatusIndicator中看到这样的消息。 Have you verified that your role does have all the modules/references set to "copy local as true" so all of them are part of deployment package. 您是否已验证您的角色确实将所有模块/引用都设置为“将本地复制为true”,所以所有这些模块/引用都是部署包的一部分。 Mainly it is a MVC3 app, you may need to manually set app MVC specific references property to copy local as true to resolved this problem. 主要是一个MVC3应用程序,您可能需要手动设置应用程序MVC特定的引用属性以将local复制为true,才能解决此问题。

Now I spent my shared amount of time dealing with this, and finally it seems to be working. 现在,我花了很多时间来解决这个问题,最后它似乎正在工作。 Not sure exactly what part solved the problem, but I'll wrap up the changes I made, in case someone else have the same issue at some point. 不确定到底是什么部分解决了问题,但是我会总结一下所做的更改,以防其他人在某个时候遇到相同的问题。

  1. While debugging this issue, I also updated my application from MVC3 to MVC4. 在调试此问题时,我还将我的应用程序从MVC3更新到了MVC4。 Not sure if that has anything to do with solving this problem, but at least it is one of the changes I made. 不知道这是否与解决此问题有关,但至少这是我所做的更改之一。
  2. I noticed that another exception was thrown by the the IntelliTrace service, so I disabled that in the deployment and re-deployed the application (my guess is that this problem is what actually caused the instances to cycle. 我注意到IntelliTrace服务引发了另一个异常,因此我在部署中禁用了该异常并重新部署了该应用程序(我想这是导致实例循环的真正原因。

Response from Microsoft Support on this issue: Microsoft支持部门对此问题的响应:

I was troubleshooting your deployment with the issue and I got a memory dump from the CacheService.exe 我正在用这个问题对您的部署进​​行故障诊断,并且从CacheService.exe获得了内存转储

This was the exception being thrown 这是抛出的异常

CLR exception type: System.TypeInitializationException "The type initializer for 'Microsoft.ApplicationServer.Caching.AzureCommon.AzureUtility' threw an exception." “ CLR异常类型:System.TypeInitializationException”'Microsoft.ApplicationServer.Caching.AzureCommon.AzureUtility'的类型初始化程序引发了异常。 ModLoad: 000007fe ea010000 000007fe ea0fa000 ea010000 000007fe :000007fe ea010000 000007fe ea0fa000
D:\\Windows\\Microsoft.NET\\Framework64\\v4.0.30319\\diasymreader.dll * ERROR: Symbol file could not be found. D:\\ Windows \\ Microsoft.NET \\ Framework64 \\ v4.0.30319 \\ diasymreader.dll *错误:找不到符号文件。 Defaulted to export symbols for D:\\windows\\system32\\KERNEL32.dll - ntdll!ZwWaitForMultipleObjects+0xa: 00000000`76f5739a c3 默认为D:\\ windows \\ system32 \\ KERNEL32.dll-ntdll!ZwWaitForMultipleObjects + 0xa导出符号:00000000`76f5739a c3
ret 退回

The exceptions on this namespace can happen if: 在以下情况下,可能会发生此名称空间上的异常:

  • You set the Microsoft.WindowsAzure.Plugins.Caching.ConfigStoreConnectionString setting on ServiceConfiguration to use the local storage emulator 您在ServiceConfiguration上设置Microsoft.WindowsAzure.Plugins.Caching.ConfigStoreConnectionString设置以使用本地存储模拟器
  • On the web.config you have the identifier value of the <dataCacheClients> section not set to the correct role name 在web.config上,您没有将<dataCacheClients>部分的标识符值设置为正确的角色名称
  • In some rare cases if you have the SDK 1.6 and 1.7 installed together this can cause some mixed up DLLs when project is being built. 在极少数情况下,如果同时安装了SDK 1.6和1.7,则在构建项目时可能会导致DLL混淆。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM