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 这个国外的云服务 ...
随机推荐
- windows management instrumentation服务未启动-解决脚本
桌面新建.txt文件 将以下代码放入 保存为.bat文件 执行即可 @echo on cd /d c:\temp if not exist %windir%\system32\wbem goto Tr ...
- 七牛php sdk 生成上传凭证时出现 undefined function Qiniu_SetKeys()
将qiniu/http.php文件改名即可,原因是xampp等集成环境会安装pear存在了http.php
- 用JS识别各版本浏览器
自昨天发了各浏览器内核介绍的随笔,就闲不住了,想直接写个JS来识别用户所用浏览器版本. 写着写着却发现很多坑爹的地方,比如IE10-的版本是依循常规支持attachEvent,但到了IE11,却只支持 ...
- mongodb(mongoose-redis-cache)
在传统的项目中,我们经常会用到缓存来优化数据库的读取,比如java中,我们利用spring的AOP能力,在读写数据库前增加对缓存的操作. 在node与mongodb的项目中也仍然会存在类似问题,本文参 ...
- 继电器是如何成为CPU的(2)
继电器是如何成为CPU的(2) ——<穿越计算机的迷雾>整理和总结 上一篇已经从电池.开关.灯泡和继电器开始,画出了设计CPU所需的基本器件.这些器件将成为设计CPU的砖瓦木料.这一篇就用 ...
- 可伸缩性最佳实践:来自eBay的经验
看到一篇关于系统可伸缩性(可扩展)的文章,eBay的架构师Randy Shoup写的,原文出处没找到,就不写转载的地址了.根据自己的理解对文章有修改剪切的地方. 在eBay,可伸缩性是我们每天奋力抵抗 ...
- java指定路径写、读文件
package com.util; import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.File; ...
- swift 项目 oc 和 swift 混用,文件相互引用
创建swift工程后,如果后面想新建 oc 文件,这时会生成一个 AppName-Bridging-Header.h文件 一,在swift 文件中 1> 引用swift 文件 什么都不需要操作 ...
- NodeJS系列~第一个小例子,实现了request.querystring功能
返回目录 百度百科上: Node.js是一套用来编写高性能网络服务器的JavaScript工具包,一系列的变化由此开始,在Node中,Http是首要的.Node为创建http服务器作了优化,所以在网上 ...
- EF架构~真正被封装的排序方法,支持多列排序
回到目录 对于linq to sql 和linq to entity来说,当你把获取数据的方法封装了之后,总觉得还缺点什么,想了之后,应该是排序,但看了微软的orchard项目之后,觉得它的排序封装的 ...