Windows Server AppFabric
最近项目中用到微软的分布缓存 记录下
1.系统 win7 64位
下载安装程序
IIS Manager for Remote Administrationhttp://www.iis.net/downloads/microsoft/iis-manager
Windows Server AppFabric
http://www.microsoft.com/zh-cn/download/details.aspx?id=15848
依次安装上面文件 并设置
执行 ProwerShell 命令:
1.Start-CacheCluster 启动集群
2.Get-CacheHost 得到host
3.Grant-CacheAllowedClientAccount 域\用户名 用户 授权
4.Get-CacheAllowedClientAccounts 得到所有用户授权
C# Code
static void Main(string[] args){//实例化配置DataCacheFactoryConfiguration configuration = new DataCacheFactoryConfiguration();//定义缓存主机List<DataCacheServerEndpoint> servers = new List<DataCacheServerEndpoint>(1);servers.Add(new DataCacheServerEndpoint(Environment.MachineName, 22233));configuration.Servers = servers;// 定义配置的安全性能属性configuration.SecurityProperties = new DataCacheSecurity(DataCacheSecurityMode.None, DataCacheProtectionLevel.None);configuration.LocalCacheProperties = new DataCacheLocalCacheProperties();DataCacheClientLogManager.ChangeLogLevel(System.Diagnostics.TraceLevel.Off);var _factory = new DataCacheFactory(configuration);//层次关系 Machine->CacheHost->Named Cache->Region->CacheItems->Object//创建数据缓存//这里测试创建2个数据缓存(Named Cache) 每个缓存里面有两个区域缓存(Region)Dictionary<string, DataCache> dataCache = new Dictionary<string, DataCache>(2);dataCache["default"] = _factory.GetCache("default");dataCache["default"].CreateRegion("OrderData_Cache");dataCache["default"].CreateRegion("ProductData_Cache");//dataCache["secone"] = _factory.GetCache("secone");//dataCache["secone"].CreateRegion("HrData_Cache");//dataCache["secone"].CreateRegion("ConsumerData_Cache");Console.WriteLine("添加缓存数据....");//添加数据dataCache["default"].Add("lvxiaojia", "Hello Word!", "OrderData_Cache");dataCache["default"].Add("xiaojia", "How Are You", "ProductData_Cache");//Console.ReadLine();Console.WriteLine("开始读取缓存读取....");Console.WriteLine(dataCache["default"].Get("lvxiaojiakey", "OrderData_Cache").ToString());Console.WriteLine(dataCache["default"].Get("xiaojiakey", "ProductData_Cache").ToString());Console.ReadLine();}
转载于:https://www.cnblogs.com/lvxiaojia/archive/2013/01/19/2867888.html
Windows Server AppFabric相关推荐
- Windows Server AppFabric Caching
这套 AppFabric Caching 比我用过的 memcached 复杂多了,MSDN有一篇文章进行介绍Introduction to Caching with Windows Server A ...
- Windows Server AppFabric Beta 2 for For Vistual Studio 2010已经发布
Windows Server AppFabric Beta 2 For Vistual Studio 2010/.NET Framework 4.0已经发布了,参看EndPonit上的博客文章http ...
- Windows Server AppFabric 缓存容量规划指南
此主题尚未评级 - 评价此主题 Jason Roth.Rama Ramani.Jaime Alva Bravo 2011 年 3 月 本白皮书为 Windows Server AppFabric 缓存 ...
- Windows Server AppFabric Caching支持大数据量的配置
Memcache支持的数据量大小为1M,最新版本可以通过配置调整突破1M(参看http://www.cnblogs.com/shanyou/archive/2010/02/01/1661271.htm ...
- Windows Server AppFabric缓存参考实例和方案选择 2/3
实例 Web Camps Training Kit[MSDN上可以下载,如下的地址] http://download.microsoft.com/download/4/D/A/4DA69FF9-A83 ...
- 在Windows Server 2012 R2上安装Sharepoint 2013
之前有在Windows Server 2008 r2上安装过Sharepoint 2013,后来因为虚拟机资源不足给删除了.现Sharepoint 2003升级至2013项目即将开始,需要重新 ...
- Windows Azure AppFabric概述
公告 :本博客为微软云计算中文博客 的镜像博客. 部分文章因为博客兼容性问题 ,会影响阅读体验 .如遇此情况,请访问 原博客 . Windows Azure AppFabric ...
- Windows Azure AppFabric 入门教学(七):多播(Multicast)
公告:本博客为微软云计算中文博客的镜像博客.部分文章因为博客兼容性问题,会影响阅读体验.如遇此情况,请访问原博客. 本文是Windows Azure AppFabric入门教学的第七篇文章.我们知道, ...
- java jdk 1.8 配置_Java开发环境jdk 1.8安装配置方法(Win7 64位系统/windows server 2008)...
什么是jdk jdk是什么呢?jdk的是java development kit的缩写,意思是java程序开发的工具包.也可以说jdk是java的sdk. 目前的JDK大致分三个大版本: Java S ...
- [转]Introduction of iSCSI Target in Windows Server 2012
Introduction of iSCSI Target in Windows Server 2012 源地址:http://blogs.technet.com/b/filecab/archive/2 ...
最新文章
- OpenCV+python:模糊操作
- 我真不想学 happens - before 了!
- 搜索进一步细化 谷歌或重回大陆
- .net mvc actionresult 返回字符串_字符串游戏之无效的身份证
- tar exclue文件夹
- iptables 开放远程_远程FX正式上市 指导价11.99万-12.99万元_搜狐汽车
- array.unshift_Ruby中带有示例的Array.unshift()方法
- 【离散数学】实验 一个简单的自动逻辑推理问题
- 用好这个数据分析工具,BI平台建设少费一半力
- Linux 命令(17)—— su 与 sudo 命令
- 거든---表示条件,后接祈使,劝诱,意志语句
- 小程序colorui引入与使用
- 迅雷“应版权方要求,文件无法下载”完美解决方法!(¥28)
- python遍历文件夹下的所有图片
- 关于Holder不等式等号成立的条件的理解
- Linux虚拟机在线添加GPT格式硬盘
- SQL Sever:关于外键引用无效表的问题
- Kotlin 编码规约
- x=1u c语言,c语言中1u是什么意思
- ROM、RAM、内存、内存条、外存、内部存储器、外部存储器、FLASH等之间的关系