Windows Azure Cloud Service (43) 使用Azure In-Role Cache缓存(2)Dedicated Role
《Windows Azure Platform 系列文章目录》
Update 2016-01-12
https://azure.microsoft.com/zh-cn/documentation/articles/cache-dotnet-how-to-use-in-role/
微软宣布Azure Managed Cache Service和Azure In-Role Cache会在2016年11月30日下线,建议所有的用户采用Redis Cache。
有关Redis Cache的内容,请参考:
http://www.cnblogs.com/threestone/category/741409.html
在上一篇的博文中Windows Azure Cloud Service (42) 使用Azure In-Role Cache缓存(1)Co-located Role
笔者介绍了如何使用Co-located Role Cache来使用缓存,本章部分内容与该博文重复,请各位读者提前预习相关知识。
本篇博客,笔者将介绍使用Dedicated Role Cache。
为什么要使用Dedicated Role Cache?
Co-located Role(共享模式)的Cache,是保存在多个Cloud Service Instance上的。
在某些情况下,企业网站的负载非常大,这时候,就需要额外的Dedicated Role Cache来专门负责Caching。
Co-located Role的架构图,请参考http://weblogs.asp.net/scottgu/meet-the-new-windows-azure

接下来开始本章内容:
1.使用管理员身份,运行Visual Studio 2013,创建一个新的Cloud Project,命名为LeiDedicatedRole。图略。
2.在New Windows Azure Cloud Service中,添加Web Role和Cache Worker Role。如下图:

3.我们点击Cloud Project,选择WebRole1,右键,选择Properties。如下图:

将Web Role的Instance Count设置为2。(Web Role Instance设置为2或者2以上,就实现了高可用。)

4.配置完WebRole1后,我们接下来配置CacheWorkerRole,如下图:

将CacheWorkerRole的Instance设置为2(或者2以上,配置高可用),图略
5.然后继续配置CacheWorkerRole的Caching信息,如下图:

(1)默认已经勾选了Enable Caching
(2)设置了Dedicated Role
(3)设置Storage Account,因为Cache Cluster(PaaS Web Role Instance)会将Runtime的信息保存在Storage,所以这里一定要设置正确
(4)Named Cache默认是default,我们可以通过Add Named Cache,增加新的Cache Name。
另外,笔者在步骤4设置了Instance Count=2,所以我们可以勾选High Availability,保证高可用。这样不会因为某台Cache Worker Role Instance因为故障宕机导致Caching丢失
6.然后我们在WebRole配置NuGet,增加Windows Azure Cache的引用。图略。具体请参考Windows Azure Cloud Service (42) 使用Azure In-Role Cache缓存(1)Co-located Role
7.修改WebRole1下的Web.config,找到autoDiscover节点,如下图:

将上图中的[Cache role name or Service Endpoint]中的节点,修改为项目文件的Cache Worker Role Name,在笔者的Sample Code中,我们设置为CacheWorkerRole1
设置完毕后的结果如下图:

这样相关的配置就完成了。
参考资料:http://blog.sanc.idv.tw/2012/06/windows-azure-windows-azure.html
Windows Azure Cloud Service (43) 使用Azure In-Role Cache缓存(2)Dedicated Role的更多相关文章
- Windows Azure Cloud Service (36) 在Azure Cloud Service配置SSL证书
<Windows Azure Platform 系列文章目录> 在某些时候,我们需要在Azure PaaS Cloud Service配置HTTPS连接.本章将介绍如何在本地创建证书,然后 ...
- Windows Azure Cloud Service (42) 使用Azure In-Role Cache缓存(1)Co-located Role
<Windows Azure Platform 系列文章目录> Update 2016-01-12 https://azure.microsoft.com/zh-cn/documentat ...
- Windows Azure Cloud Service (11) PaaS之Web Role, Worker Role(上)
<Windows Azure Platform 系列文章目录> 本文是对Windows Azure Platform (六) Windows Azure应用程序运行环境内容的补充. 我们知 ...
- [SDK2.2]Windows Azure Cloud Service (35) 使用VS2013发布Azure Cloud Service
<Windows Azure Platform 系列文章目录> 好久没有更新BLOG了,今天我们继续Windows Azure相关的内容. 笔者最近把Visual Studio升级到了20 ...
- Windows Azure Cloud Service (38) 微软IaaS与PaaS比较
<Windows Azure Platform 系列文章目录> 最近一直想总结Azure IaaS和PaaS的区别与比较,写个博文详细说明一下.建议读者在阅读之前,先熟悉微软PaaS和Ia ...
- Windows Azure Cloud Service (39) 如何将现有Web应用迁移到Azure PaaS平台
<Windows Azure Platform 系列文章目录> 本文将简单介绍,如何将企业内现有的ASP.NET应用程序迁移到Azure PaaS平台. 因为在迁移过程中,可能需要对现有的 ...
- Windows Azure Cloud Service (44) 将Cloud Service加入Virtual Network Subnet,并固定Virtual IP Address(VIP)
<Windows Azure Platform 系列文章目录> 在之前的文章中,笔者已经详细介绍了如何将Virtual Machine加入Virtual Network,并且绑定固定的Pr ...
- Windows Azure Cloud Service (47) 修改Cloud Service时区
<Windows Azure Platform 系列文章目录> 本文介绍内容适合于Azure Global和Azure China 我们在使用Cloud Service的时候,会发现默认的 ...
- 如何使用 OneAPM 监控微软 Azure Cloud Service ?
不知不觉微软 Azure 已经进入中国市场近两年的时间.那么 Azure 平台的性能究竟如何?资源加载的延迟.虚拟机的稳定性等问题是否切实满足客户期许.这些都是大家对微软 Azure 这个国外的云服务 ...
随机推荐
- 一个简单的RMAN自动备份脚本
rman备份脚本: #!/bin/bashsource /home/oracle/.bash_profile rman target / << EOFrun {allocate chann ...
- SQL 数据库性能问题排查
一个项目的运行,总伴随着性能问题,系统查询过慢,如何快速查询等 下面将简单讲解一下,如何去排查及解决这些问题. 开发过程中: 1:不要绝对的三范式,适当建立冗余能够提高查询速度,不用多表关联 2:能用 ...
- 【转载】解决Windows 10 局域网内共享的问题
问题: 小米盒子,iPhone (OS 10.2) 无法访问 Win 1o共享 解决方案: 原文链接 http://www.dedoimedo.com/computers/windows-10-net ...
- PyQt5应用与实践
一个典型的GUI应用程序可以抽象为:主界面(菜单栏.工具栏.状态栏.内容区域),二级界面(模态.非模态),信息提示(Tooltip),程序图标等组成.本篇根据作者使用PyQt5编写的一个工具,介绍如何 ...
- Mybatis错误(一)org.apache.ibatis.exceptions.PersistenceException
在映射文件中,通过parameterType指定输入参数的类型,类型可以是简单类型.hashmap.pojo的包装类型.在测试包装类型过程中产生了一个错误:org.apache.ibatis.exce ...
- ./在Linux下是什么意思
在网上找的答案: . 在这里表示的是当前目录,就像 .. 表示上级目录一样. 这个 / 表示的是目录级别的分隔符,他之前的就是目录名,./aaa/ 表明的就是 . (也就是当前目录)下面的 aaa 目 ...
- CentOS 6.6下Redis安装配置记录
转载于:http://www.itxuexiwang.com/a/shujukujishu/redis/2016/0216/120.html?1455855209 在先前的文章中介绍过redis,以下 ...
- salesforce 零基础学习(二十五)PickList简单联动操作
有的时候,项目需要一些联动的操作,比如省和市之间的联动,不同的省应该显示不同的城市. 操作步骤如下: 1.新建provice字段,并且初始化相关的值 2.新建city字段,并且初始化相关的值 3.在P ...
- js生成随即字符串
js生成随即字符串 /* *js生成随即字符串原来如此简单 *toString() radix argument must be between 2 and 36 */ function uuid() ...
- tool list
http://www.pairwise.org/tools.asp 用例设计工具 组合测试工具pict 代码调试 Findbugs 介绍及使用方法 接口测试工具 webservices studi ...