简体   繁体   English

Azure缓存-升级到SDK 2.1和缓存2.1后失败

[英]Azure Caching - Failure after upgrading to SDK 2.1 and caching 2.1

It looks like there are a number of questions already open on this topic, but I believe mine might be different. 似乎已经有许多关于此主题的问题,但我相信我的可能有所不同。 My setup: 我的设置:

  • 1 Azure Cache Worker Role 1个Azure缓存工作者角色
  • 1 Web Role 1个网络角色

Up until about a week ago, they existed in harmony, until I tried to upgrade to Azure caching 2.1. 直到大约一周前,它们和谐共存,直到我尝试升级到Azure缓存2.1。 Once I did that, I was afflicted with the "No such host is known" problem that seems to have affected many developers out there. 一旦这样做,我就感到困扰“似乎没有这样的主机”的问题,这个问题似乎已经影响了许多开发人员。 I found many questions and sites that directed me to upgrade my Azure SDK installation to the new 2.1 version. 我发现了许多问题和站点,这些站点和站点指示我将Azure SDK安装升级到新的2.1版本。 I have done all of these things: 我已经做了所有这些事情:

  • Install newest Azure SDK 2.1 安装最新的Azure SDK 2.1
  • Uninstall Azure SDK 2.0 卸载Azure SDK 2.0
  • Uninstall and Reinstall Azure Caching 2.1 卸载并重新安装Azure Caching 2.1
  • Triple check configuration of all my caching settings 三遍检查我所有缓存设置的配置
  • Triple check that all references are pointing to the newest versions and not the old ones 三重检查所有引用都指向最新版本,而不是旧版本
  • Upgrade my Azure Project to 2.1 by right-click, going to Properties, and clicking Upgrade 右键单击我的Azure Project到2.1,然后单击“属性”,然后单击“升级”。

and I am still getting the following ( My Error ): 而且我仍然得到以下( 我的错误 ):

Exception type: SocketException 
Exception message: No such host is known
at System.Net.Dns.HostResolutionEndHelper(IAsyncResult asyncResult)

This is different than the more typical error that most other questions and sites are showing, which is ( More commonly reported error, not mine ): 这不同于大多数其他问题和站点显示的更典型的错误,即( 更常见的报告错误,不是我的 ):

No such host is known 
Exception message: No such host is known
at Microsoft.ApplicationServer.Caching.AsyncResultNoResult.EndInvoke()

I am about 30 hours into troubleshooting this, and could really use some help. 我大约需要30个小时来解决此问题,并且确实可以使用一些帮助。 Maybe I am just missing some step about the upgrade of the SDK? 也许我只是缺少一些有关SDK升级的步骤? Somehow maybe sneakily it is still using an old version of a DLL? 也许以某种方式偷偷地仍在使用旧版本的DLL? Is there some foolproof way to check this besides looking at the path of every reference in the project (which I have already done, and they all match up)? 除了查看项目中每个引用的路径(我已经做过,而且它们都匹配)之外,是否还有某种万无一失的方法来检查这一点?

Not really an answer but some comments which might help you diagnose the problem: 并不是真正的答案,而是一些可以帮助您诊断问题的评论:

  • Visual Studio 2012/Update 3 - Please ensure that you have latest updates applied to VS. Visual Studio 2012 /更新3-请确保您已将最新更新应用于VS。 We had gone through similar problems and this was one of the things that helped us. 我们遇到了类似的问题,这是帮助我们的事情之一。
  • Collect lots of cache diagnostics data - In your cache configuration section, change the Microsoft.WindowsAzure.Plugins.Caching.DiagnosticLevel value to 4 in your cache worker role's configuration section. 收集大量缓存诊断数据 -在“缓存配置”部分中,将“缓存工作角色”的“配置”部分中的Microsoft.WindowsAzure.Plugins.Caching.DiagnosticLevel值更改为4 After you do that, add the following lines of code in your cache worker role's OnStart() method: 完成此操作后,在缓存工作器角色的OnStart()方法中添加以下代码行:

     DiagnosticMonitorConfiguration dmConfig = DiagnosticMonitor.GetDefaultInitialConfiguration(); // Configure the collection of cache diagnostic data. CacheDiagnostics.ConfigureDiagnostics(dmConfig); DiagnosticMonitor.Start("Microsoft.WindowsAzure.Plugins.Diagnostics.ConnectionString", dmConfig); return base.OnStart(); 

Hopefully this should give you an idea about what exactly is going on. 希望这应该使您对到底发生了什么有所了解。

This also is not a direct answer to your problem but I think it may prove helpful to resolve your situation. 这也不是直接解决您的问题的方法,但我认为这可能有助于解决您的问题。

I've got this exception when I run my hosted service in the compute emulator and the cache was disabled on purpose -- in previous version of Windows Azure Caching an exception would be thrown on DataCacheFactory construction and I would handle it properly, while with version 2.1 (and Azure SDK 2.1) the DataCacheFactory is constructed without errors but then I've got stuck on DataCache construction for 3 minutes before the exception you mention is thrown. 当我在计算模拟器中运行托管服务并且故意禁用缓存时,我遇到了此异常-在以前版本的Windows Azure缓存中, DataCacheFactory构造中会抛出异常,而对于版本,我会正确处理2.1(和Azure SDK 2.1)构造了DataCacheFactory ,没有错误,但是在抛出您提到的异常之前,我在DataCache构造上停留了3分钟。

I've used the procedure described by Gaurav Mantri in his answer and I've been able to discover that in previous versions of Windows Azure Caching the DataCacheFactory would throw an exception if the cache role was not found in the csdef , while in 2.1 it would consider the cache role name as an address in the network -- thus causing the 3 minute wait and the subsequent exception. 我在回答中使用了Gaurav Mantri描述的过程,并且发现在Windows Azure的csdef ,如果在csdef找不到缓存角色,则DataCacheFactory会引发异常,而在2.1中,会将缓存角色名称视为网络中的地址-从而导致3分钟的等待以及随后的异常。

I've thus adapted my code to detect this new behavior -- for more detail see this SO question 因此,我调整了代码以检测这种新行为-有关更多详细信息,请参见此SO问题

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

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