配置本地和云上的蔚蓝共享缓存 [英] Configure azure shared cache locally and on the cloud

查看:160
本文介绍了配置本地和云上的蔚蓝共享缓存的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在与得到共享缓存的工作完全丧失。

I'm at a complete loss with getting the shared caching to work.

在本地,我有一个mvc4网站运行,我从这个创建了一个云计算项目。我启用的角色缓存,并设置这是位于同一位置。所有罚款为止。

Locally, I've got an mvc4 site running and I created a cloud project from this. I enabled caching on the role and set this to be co-located. All fine so far.

我是从的NuGet添加的的Windows Azure缓存 2.1包其中安装相应的库和也更新我的web配置:

I added the Windows Azure Caching 2.1 package from NuGet which installed the relevant libraries and also updated my web config:

configSections

<section name="dataCacheClients" type="Microsoft.ApplicationServer.Caching.DataCacheClientsSection, Microsoft.ApplicationServer.Caching.Core" allowLocation="true" allowDefinition="Everywhere" />
<section name="cacheDiagnostics" type="Microsoft.ApplicationServer.Caching.AzureCommon.DiagnosticsConfigurationSection, Microsoft.ApplicationServer.Caching.AzureCommon" allowLocation="true" allowDefinition="Everywhere" />

配置

<dataCacheClients>
<dataCacheClient name="default">
  <!--To use the in-role flavor of Windows Azure Caching, set identifier to be the cache cluster role name -->
  <!--To use the Windows Azure Caching Service, set identifier to be the endpoint of the cache cluster -->
  <autoDiscover isEnabled="true" identifier="" />
  <!--<localCache isEnabled="true" sync="TimeoutBased" objectCount="100000" ttlValue="300" />-->
  <!--Use this section to specify security settings for connecting to your cache. This section is not required if your cache is hosted on a role that is a part of your cloud service. -->
  <!--<securityProperties mode="Message" sslEnabled="false">
    <messageSecurity authorizationInfo="[Authentication Key]" />
  </securityProperties>-->
</dataCacheClient>


  
    
  

当我按照说明和添加的角色名称标识符属性自动发现元素上并运行应用程序,它似乎只是挂(我假设失败)本:

When I follow the instructions and add the role name to identifer attribute on the autoDiscover element and run the app, it seems to just hang (I'm assuming failing) on this:

_cache = new DataCache("default");

我有存储模拟器运行,并从计算模拟器的现场调试。我似乎无法获得该网站的工作配置为使用蔚蓝的缓存。

I have the storage emulator running and the site debugging from the compute emulator. I just can't seem to get the site to work configured to use the azure cache.

推荐答案

请确保你使用的SDK版本2.1。 缓存2.1包将仅与SDK 最新版本的工作(见下面的截图)。你可能想在这里看看这个主题:<一href=\"http://stackoverflow.com/questions/17991166/exception-while-using-windows-azure-caching-no-such-host-is-known\">Exception在使用Windows Azure的缓存:没有这样的主机

Please make sure that you're using SDK version 2.1. Caching 2.1 package will only work with the latest version of SDK (see the screenshot below). You may want to check out this thread here: Exception while using Windows Azure Caching : No such host is known

这篇关于配置本地和云上的蔚蓝共享缓存的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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