使用 Windows Azure 缓存时出现异常:不知道此类主机 [英] Exception while using Windows Azure Caching : No such host is known

查看:20
本文介绍了使用 Windows Azure 缓存时出现异常:不知道此类主机的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试开始使用 Azure 并尝试使用缓存功能.我创建了一个云服务项目并添加了一个缓存工作者角色和一个 Web 角色.我在两个角色的项目中安装了Windows Azure 缓存"nuget,并在 web 角色的 web.config 中的 DataCacheClients 元素中添加了缓存工作角色的名称作为标识符.

I am trying to get started with Azure and am trying to use the Caching feature. I created a cloud service project and added a Cache worker role and a web role. I installed "Windows Azure Caching" nuget into projects for both the roles and added the name of cache worker role as identifier in DataCacheClients element in web.config of the web role.

我在 web 角色中添加了以下代码:

I added the following code into the web role:

DataCacheFactory cf = new DataCacheFactory();
DataCache c = cf.GetDefaultCache();

当我尝试在模拟器上本地运行此程序时,出现以下异常:

When I try to run this locally on the emulator, I get the following exception:

    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://MvcWebRole1:24233.


Inner Exception : No such host is known

你能告诉我我在这里遗漏了什么吗?

Can you please tell me what I am missing here?

使用的 Azure SDK:v2.0

Azure SDK used : v2.0

推荐答案

提出问题的时机再好不过了.我们也面临着完全相同的问题,并且正在绞尽脑汁想知道问题可能是什么.我们有一个项目,一切都运行良好,而在一个项目中,我们遇到了同样的错误.根据我们的研究,我们已经确定了用于缓存的 Nuget 包的问题.昨天似乎发布了一个新版本(2.1.0.0),我们发现如果我们安装该软件包,就会出现此错误.你能检查你的情况下的包版本吗?文档指出,此新版本只能与今天发布的最新 SDK (2.1) 一起使用.

Timing of your question couldn't be better. We also faced exactly the same issue and were scrathing our head as to what the problem could be. We had one project where everything worked perfectly fine and in one we were getting the same error. Based on our research, we have identified the problem with the Nuget package for caching. It seems a new version (2.1.0.0) was released yesterday and we found that if we install that package, we get this error. Can you check the package version in your case? The documentation states that this new version can only be used with the latest SDK (2.1) released today.

一种解决方案是卸载 2.1.0.0 版并安装 2.0.0.0 版.要安装 2.0.0.0 版,请打开包管理器控制台(View --> Other Windows --> Package Manager Console)并在那里输入以下命令:

One solution would be to uninstall version 2.1.0.0 and install version 2.0.0.0. To install version 2.0.0.0, open Package Manager Console (View --> Other Windows --> Package Manager Console) and type following command there:

Install-Package Microsoft.WindowsAzure.Caching -Version 2.0.0.0

这解决了我们的问题.希望它也能解决你的问题.

This fixed our problem. Hopefully it should fix yours too.

这篇关于使用 Windows Azure 缓存时出现异常:不知道此类主机的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆