redis是否win10 32支持多大内存win32c++

redis&&FLUSHDBOK执行&&则返回键空间上现有的键值对:redis&&DBSIZE(integer)&0还可以用&&设置一个字符串键到键空间, 并用&&从键空间中取出该字符串键的值:redis&&SET&number&10086OKredis&&GET&number"10086"redis&&DBSIZE(integer)&1后面的《》一章会对键空间以及数据库的实现作详细的介绍, 到时我们将看到, 大部分针对数据库的命令, 比如&&、&、:ref:RANDOMKEY&, 等等, 都是构建于对字典的操作之上的; 而那些创建、更新、删除和查找键值对的命令, 也无一例外地需要在键空间上进行操作。用作 Hash 类型键的其中一种底层实现Redis 的 Hash 类型键使用以下两种数据结构作为底层实现:字典;;因为压缩列表比字典更节省内存, 所以程序在创建新 Hash 键时, 默认使用压缩列表作为底层实现, 当有需要时, 程序才会将底层实现从压缩列表转换到字典。当用户操作一个 Hash 键时, 键值在底层就可能是一个哈希表:redis&&HSET&book&name&"The&design&and&implementation&of&Redis"(integer)&1redis&&HSET&book&type&"source&code&analysis"(integer)&1redis&&HSET&book&release-date&""(integer)&1redis&&HGETALL&book1)&"name"2)&"The&design&and&implementation&of&Redis"3)&"type"4)&"source&code&analysis"5)&"release-date"6)&""《》章节给出了关于哈希类型键的更多信息, 并介绍了压缩列表和字典之间的转换条件。介绍完了字典的用途, 现在让我们来看看字典数据结构的定义。字典的实现实现字典的方法有很多种:最简单的就是使用链表或数组, 但是这种方式只适用于元素个数不多的情况下;要兼顾高效和简单性,可以使用哈希表;如果追求更为稳定的性能特征, 并且希望高效地实现排序操作的话, 则可以使用更为复杂的平衡树;在众多可能的实现中, Redis 选择了高效且实现简单的哈希表作为字典的底层实现。dict.h/dict&给出了这个字典的定义:/*&*&字典&*&*&每个字典使用两个哈希表,用于实现渐进式&rehash&*/typedef&struct&dict&{&&&&//&特定于类型的处理函数&&&&dictType&*&&&&//&类型处理函数的私有数据&&&&void&*&&&&//&哈希表(2个)&&&&dictht&ht[2];&&&&//&记录&rehash&进度的标志,值为-1&表示&rehash&未进行&&&&int&&&&&//&当前正在运作的安全迭代器数量&&&&int&}&以下是用于处理&dict&类型的 API , 它们的作用及相应的算法复杂度:操作类型操作函数算法复杂度创建创建一个新字典dictCreateO(1)添加/更新添加新键值对到字典dictAddO(1)添加或更新给定键的值dictReplaceO(1)获取在字典中查找给定键所在的节点dictFindO(1)在字典中查找给定键的值dictFetchValueO(1)从字典中随机返回一个节点dictGetRandomKeyO(N)删除根据给定键,删除字典中的键值对dictDeleteO(1)清空并释放字典dictReleaseO(N)清空并重置(但不释放)字典dictEmptyO(N)空间调整缩小字典dictResizeO(N)扩大字典dictExpandO(N)对字典进行给定步数的 rehashdictRehashO(N)在给定毫秒内,对字典进行rehashdictRehashMillisecondsO(N)注意&dict&类型使用了两个指针分别指向两个哈希表。其中, 0 号哈希表(ht[0])是字典主要使用的哈希表, 而 1 号哈希表(ht[1])则只有在程序对 0 号哈希表进行 rehash 时才使用。接下来两个小节将对哈希表的实现,以及哈希表所使用的哈希算法进行介绍。哈希表实现字典所使用的哈希表实现由&dict.h/dictht&类型定义:/*&*&哈希表&*/typedef&struct&dictht&{&&&&//&哈希表节点指针数组(俗称桶,bucket)&&&&dictEntry&**&&&&//&指针数组的大小&&&&unsigned&long&&&&&//&指针数组的长度掩码,用于计算索引值&&&&unsigned&long&&&&&//&哈希表现有的节点数量&&&&unsigned&long&}&table&属性是一个数组, 数组的每个元素都是一个指向&dictEntry&结构的指针。每个&dictEntry&都保存着一个键值对, 以及一个指向另一个&dictEntry&结构的指针:/*&*&哈希表节点&*/typedef&struct&dictEntry&{&&&&//&键&&&&void&*&&&&//&值&&&&union&{&&&&&&&&void&*&&&&&&&&uint64_t&u64;&&&&&&&&int64_t&s64;&&&&}&v;&&&&//&链往后继节点&&&&struct&dictEntry&*}&dictEnext&属性指向另一个&dictEntry&结构, 多个&dictEntry&可以通过&next&指针串连成链表, 从这里可以看出,&dictht&: 当多个不同的键拥有相同的哈希值时,哈希表用一个链表将这些键连接起来。下图展示了一个由&dictht&和数个&dictEntry&组成的哈希表例子:如果再加上之前列出的&dict&类型,那么整个字典结构可以表示如下:在上图的字典示例中, 字典虽然创建了两个哈希表, 但正在使用的只有 0 号哈希表, 这说明字典未进行 rehash 状态。哈希算法Redis 目前使用两种不同的哈希算法:MurmurHash2 32 bit 算法:这种算法的分布率和速度都非常好, 具体信息请参考 MurmurHash 的主页:&。基于 djb 算法实现的一个大小写无关散列算法:具体信息请参考&&。使用哪种算法取决于具体应用所处理的数据:命令表以及 Lua 脚本缓存都用到了算法 2 。算法 1 的应用则更加广泛:数据库、集群、哈希键、阻塞操作等功能都用到了这个算法。创建新字典dictCreate&函数创建并返回一个新字典:dict&*d&=&dictCreate(&hash_type,&NULL);d&的值可以用图片表示如下:新创建的两个哈希表都没有为&table&属性分配任何空间:ht[0]-&table&的空间分配将在第一次往字典添加键值对时进行;ht[1]-&table&的空间分配将在 rehash 开始时进行;添加键值对到字典根据字典所处的状态, 将一个给定的键值对添加到字典可能会引起一系列复杂的操作:如果字典为未初始化(也即是字典的 0 号哈希表的&table&属性为空),那么程序需要对 0 号哈希表进行初始化;如果在插入时发生了键碰撞,那么程序需要处理碰撞;如果插入新元素使得字典满足了 rehash 条件,那么需要启动相应的 rehash 程序;当程序处理完以上三种情况之后,新的键值对才会被真正地添加到字典上。整个添加流程可以用下图表示:在接下来的三节中, 我们将分别看到添加操作如何在以下三种情况中执行:字典为空;添加新键值对时发生碰撞处理;添加新键值对时触发了 rehash 操作;添加新元素到空白字典当第一次往空字典里添加键值对时, 程序会根据&dict.h/DICT_HT_INITIAL_SIZE&里指定的大小为&d-&ht[0]-&table&分配空间 (在目前的版本中,&DICT_HT_INITIAL_SIZE&的值为&4&)。以下是字典空白时的样子:以下是往空白字典添加了第一个键值对之后的样子:添加新键值对时发生碰撞处理在哈希表实现中, 当两个不同的键拥有相同的哈希值时, 我们称这两个键发生碰撞(collision), 而哈希表实现必须想办法对碰撞进行处理。字典哈希表所使用的碰撞解决方法被称之为: 这种方法使用链表将多个哈希值相同的节点串连在一起, 从而解决冲突问题。假设现在有一个带有三个节点的哈希表,如下图:对于一个新的键值对&key4&和&value4&, 如果&key4&的哈希值和&key1&的哈希值相同, 那么它们将在哈希表的&0&号索引上发生碰撞。通过将&key4-value4&和&key1-value1&两个键值对用链表连接起来, 就可以解决碰撞的问题:添加新键值对时触发了 rehash 操作对于使用链地址法来解决碰撞问题的哈希表&dictht&来说, 哈希表的性能依赖于它的大小(size属性)和它所保存的节点的数量(used属性)之间的比率:比率在 1:1 时,哈希表的性能最好;如果节点数量比哈希表的大小要大很多的话,那么哈希表就会退化成多个链表,哈希表本身的性能优势就不再存在;举个例子, 对于下面这个哈希表, 平均每次失败查找只需要访问 1 个节点(非空节点访问 2 次,空节点访问 1 次):而对于下面这个哈希表, 平均每次失败查找需要访问 5 个节点:为了在字典的键值对不断增多的情况下保持良好的性能, 字典需要对所使用的哈希表(ht[0])进行 rehash 操作: 在不修改任何键值对的情况下,对哈希表进行扩容, 尽量将比率维持在 1:1 左右。dictAdd&在每次向字典添加新键值对之前, 都会对哈希表&ht[0]&进行检查, 对于&ht[0]&的&size&和&used&属性, 如果它们之间的比率&ratio&=used&/&size&满足以下任何一个条件的话,rehash 过程就会被激活:自然 rehash :&ratio&&=&1&,且变量&dict_can_resize&为真。强制 rehash :&ratio&大于变量&dict_force_resize_ratio&(目前版本中,&dict_force_resize_ratio&的值为&5&)。什么时候&dict_can_resize&会为假?在前面介绍字典的应用时也说到过, 一个数据库就是一个字典, 数据库里的哈希类型键也是一个字典, 当 Redis 使用子进程对数据库执行后台持久化任务时(比如执行&BGSAVE&或&BGREWRITEAOF&时), 为了最大化地利用系统的&&机制, 程序会会暂时将&dict_can_resize&设为假, 避免执行自然 rehash , 从而减少程序对内存的触碰(touch)。当持久化任务完成之后,&dict_can_resize&会重新被设为真。另一方面, 当字典满足了强制 rehash 的条件时, 即使&dict_can_resize&不为真(有&BGSAVE&或&BGREWRITEAOF&正在执行), 这个字典一样会被 rehash 。Rehash 执行过程字典的 rehash 操作实际上就是执行以下任务:创建一个比&ht[0]-&table&更大的&ht[1]-&table&;将&ht[0]-&table&中的所有键值对迁移到&ht[1]-&table&;将原有&ht[0]&的数据清空,并将&ht[1]&替换为新的&ht[0]&;经过以上步骤之后, 程序就在不改变原有键值对数据的基础上, 增大了哈希表的大小。作为例子, 以下四个小节展示了一次对哈希表进行 rehash 的完整过程。1. 开始 rehash这个阶段有两个事情要做:设置字典的&rehashidx&为&0&,标识着 rehash 的开始;为&ht[1]-&table&分配空间,大小至少为&ht[0]-&used&的两倍;这时的字典是这个样子:2. Rehash 进行中在这个阶段,&ht[0]-&table&的节点会被逐渐迁移到&ht[1]-&table&, 因为 rehash 是分多次进行的(细节在下一节解释), 字典的&rehashidx变量会记录 rehash 进行到&ht[0]&的哪个索引位置上。以下是&rehashidx&值为&2&时,字典的样子:注意除了节点的移动外, 字典的&rehashidx&、&ht[0]-&used&和&ht[1]-&used&三个属性也产生了变化。3. 节点迁移完毕到了这个阶段,所有的节点都已经从&ht[0]&迁移到&ht[1]&了:4. Rehash 完毕在 rehash 的最后阶段,程序会执行以下工作:释放&ht[0]&的空间;用&ht[1]&来代替&ht[0]&,使原来的&ht[1]&成为新的&ht[0]&;创建一个新的空哈希表,并将它设置为&ht[1]&;将字典的&rehashidx&属性设置为&-1&,标识 rehash 已停止;以下是字典 rehash 完毕之后的样子:对比字典 rehash 之前和 rehash 之后, 新的&ht[0]&空间更大, 并且字典原有的键值对也没有被修改或者删除。渐进式 rehash在上一节,我们了解了字典的 rehash 过程, 需要特别指出的是, rehash 程序并不是在激活之后就马上执行直到完成的, 而是分多次、渐进式地完成的。假设这样一个场景:在一个有很多键值对的字典里, 某个用户在添加新键值对时触发了 rehash 过程, 如果这个 rehash 过程必须将所有键值对迁移完毕之后才将结果返回给用户, 这样的处理方式将是非常不友好的。另一方面, 要求服务器必须阻塞直到 rehash 完成, 这对于 Redis 服务器本身也是不能接受的。为了解决这个问题, Redis 使用了渐进式(incremental)的 rehash 方式: 通过将 rehash 分散到多个步骤中进行, 从而避免了集中式的计算。渐进式 rehash 主要由&_dictRehashStep&和&dictRehashMilliseconds&两个函数进行:_dictRehashStep&用于对数据库字典、以及哈希键的字典进行被动 rehash ;dictRehashMilliseconds&则由 Redis 服务器常规任务程序(server cron job)执行,用于对数据库字典进行主动 rehash ;_dictRehashStep每次执行&_dictRehashStep&,&ht[0]-&table&哈希表第一个不为空的索引上的所有节点就会全部迁移到&ht[1]-&table&。在 rehash 开始进行之后(d-&rehashidx&不为&-1), 每次执行一次添加、查找、删除操作,&_dictRehashStep&都会被执行一次:因为字典会保持哈希表大小和节点数的比率在一个很小的范围内, 所以每个索引上的节点数量不会很多(从目前版本的 rehash 条件来看,平均只有一个,最多通常也不会超过五个), 所以在执行操作的同时,对单个索引上的节点进行迁移, 几乎不会对响应时间造成影响。dictRehashMillisecondsdictRehashMilliseconds&可以在指定的毫秒数内, 对字典进行 rehash 。当 Redis 的服务器常规任务执行时,&dictRehashMilliseconds&会被执行, 在规定的时间内, 尽可能地对数据库字典中那些需要 rehash 的字典进行 rehash , 从而加速数据库字典的 rehash 进程(progress)。其他措施在哈希表进行 rehash 时, 字典还会采取一些特别的措施, 确保 rehash 顺利、正确地进行:因为在 rehash 时,字典会同时使用两个哈希表,所以在这期间的所有查找、删除等操作,除了在&ht[0]&上进行,还需要在&ht[1]&上进行。在执行添加操作时,新的节点会直接添加到&ht[1]&而不是&ht[0]&,这样保证&ht[0]&的节点数量在整个 rehash 过程中都只减不增。字典的收缩上面关于 rehash 的章节描述了通过 rehash 对字典进行扩展(expand)的情况, 如果哈希表的可用节点数比已用节点数大很多的话, 那么也可以通过对哈希表进行 rehash 来收缩(shrink)字典。收缩 rehash 和上面展示的扩展 rehash 的操作几乎一样,它执行以下步骤:创建一个比&ht[0]-&table&小的&ht[1]-&table&;将&ht[0]-&table&中的所有键值对迁移到&ht[1]-&table&;将原有&ht[0]&的数据清空,并将&ht[1]&替换为新的&ht[0]&;扩展 rehash 和收缩 rehash 执行完全相同的过程, 一个 rehash 是扩展还是收缩字典, 关键在于新分配的&ht[1]-&table&的大小:如果 rehash 是扩展操作,那么&ht[1]-&table&比&ht[0]-&table&要大;如果 rehash 是收缩操作,那么&ht[1]-&table&比&ht[0]-&table&要小;对于不同的字典, Redis 使用不同的收缩和扩展策略:数据库字典可以扩展也可以收缩,具体信息请参考《》一章的《》小节;哈希键的字典只扩展,不收缩;字典其他操作除了添加操作和伸展/收缩操作之外, 字典还定义了其他一些操作, 比如常见的查找、删除和更新。因为链地址法哈希表实现的相关信息可以从任何一本数据结构或算法书上找到, 这里不再对字典的其他操作进行介绍, 不过前面对创建字典、添加键值对、收缩和扩展 rehash 的讨论已经涵盖了字典模块的核心内容。字典的迭代字典带有自己的实现 —— 对字典进行迭代实际上就是对字典所使用的哈希表进行迭代:迭代器首先迭代字典的第一个哈希表, 然后,如果 rehash 正在进行的话, 就继续对第二个哈希表进行迭代。当迭代哈希表时, 找到第一个不为空的索引, 然后迭代这个索引上的所有节点。当这个索引迭代完了, 继续查找下一个不为空的索引, 如此循环, 一直到整个哈希表都迭代完为止。整个迭代过程可以用伪代码表示如下:def&iter_dict(dict):&&&&#&迭代&0&号哈希表&&&&iter_table(ht[0]-&table)&&&&#&如果正在执行&rehash&,那么也迭代&1&号哈希表&&&&if&dict.is_rehashing():&iter_table(ht[1]-&table)def&iter_table(table):&&&&#&遍历哈希表上的所有索引&&&&for&index&in&table:&&&&&&&&#&跳过空索引&&&&&&&&if&table[index].empty():&&&&&&&&&&&&continue&&&&&&&&#&遍历索引上的所有节点&&&&&&&&for&node&in&table[index]:&&&&&&&&&&&&#&处理节点&&&&&&&&&&&&do_something_with(node)字典的迭代器有两种:安全迭代器:在迭代进行过程中,可以对字典进行修改。不安全迭代器: 在迭代进行过程中,不对字典进行修改。以下是迭代器的数据结构定义:/*&*&字典迭代器&*/typedef&struct&dictIterator&{&&&&dict&*d;&&&&&&&&&&&&&&&&//&正在迭代的字典&&&&int&table,&&&&&&&&&&&&&&//&正在迭代的哈希表的号码(0&或者&1)&&&&&&&&index,&&&&&&&&&&&&&&//&正在迭代的哈希表数组的索引&&&&&&&&&&&&&&&&&&&&&&&//&是否安全?&&&&dictEntry&*entry,&&&&&&&//&当前哈希节点&&&&&&&&&&&&&&*nextE&&&//&当前哈希节点的后继节点}&dictI以下函数是这个迭代器的 API ,它们的作用及相关算法复杂度:函数作用算法复杂度dictGetIterator创建一个不安全迭代器。O(1)dictGetSafeIterator创建一个安全迭代器。O(1)dictNext返回迭代器指向的当前节点,如果迭代完毕,返回&NULL&。O(1)dictReleaseIterator释放迭代器。O(1)小结字典由键值对构成的抽象数据结构。Redis 中的数据库和哈希键都基于字典来实现。Redis 字典的底层实现为哈希表,每个字典使用两个哈希表,一般情况下只使用 0 号哈希表,只有在 rehash 进行时,才会同时使用 0 号和 1 号哈希表。哈希表使用链地址法来解决键冲突的问题。Rehash 可以用于扩展或收缩哈希表。对哈希表的 rehash 是分多次、渐进式地进行的。当前访客身份:游客 [
当前位置:
acl redis C++ 库被 redis 官方收录
acl 库中的新增模块 redis C++ 客户端库被 redis 官方正式收录,参见 http://redis.io/clients 中的 C++ 部分,其中 “redis-client for C++” 库即为 acl redis C++ 客户端库。acl 中的 redis 库属于 lib_acl_cpp 库的一部分,提供了 redis 官方所要求的 12 个大类 150+ 个 redis 客户端命令的实现,为了方便使用,在该库中针对每个 redis 指令提供了多个接口函数。同时,该库还支持最新的集群版 redis3.0 规范的要求。
acl 库是一个跨平台(支持UNIX/LINUX/MAC/BSD/SOLARIS/WIN32)的网络通信与服务器通信框架,主要包括以下功能:
包括以下丰富的常用函数库:1、常见网络应用库: SMTP 客户端库/PING 库/memcache 客户端库/handlersocket 客户端库/beanstalk 客户端库2、HTTP 网络库:HTTP 客户端/服务端库,C++版 HttpServlet 类,HTTP COOKIE/HTTP SESSION 等3、邮件解析库:mime解析库/RFC2047/RFC2048/mime base64/mime qp/mime uucode 等4、网络通信库:阻塞/非阻塞网络 IO 库(其中 lib_acl_cpp 库通过嵌入 polarssl 而具备了 SSL 的能力)5、服务器框架:包括进程池模式、线程池模式、非阻塞模式、UDP通信模式及触发器模式6、事件引擎:支持 select、poll(for unix)、epoll(for linux)、kqueue(for bsd)、devpoll(for solaris)、iocp(for win32)、win32 窗口消息(for win32)事件引擎7、通用连接池库:高效的连接池基础类库,支持丰富的功能8、数据库客户端库:对原生的数据库客户端库进行了二次封装,使编程更为简易,功能更为丰富9、xml/json 流式解析库:区别于网上其它已有的 xml/json 解析库,acl 中的 xml/json 解析库采用有限状态机方式解析数据,处理方式更为灵活
参考地址:
acl 库国内镜向:http://git.oschina.net/zsxxsz/acl/tree/master
redis 模块头文件:http://git.oschina.net/zsxxsz/acl/tree/master/lib_acl_cpp/include/acl_cpp/redis
redis 模块源文件:http://git.oschina.net/zsxxsz/acl/tree/master/lib_acl_cpp/src/redis
redis 模块示例:http://git.oschina.net/zsxxsz/acl/tree/master/lib_acl_cpp/samples/redis
github 镜向:/zhengshuxin/acl
acl 的详细介绍:
acl 的下载地址:
acl 的源码地址:
想通过手机客户端(支持 Android、iPhone 和 Windows Phone)访问开源中国:
旧一篇: 9个月前
新一篇: 9个月前
相关讨论话题
你也许会喜欢
2楼:vingzhang
3楼:梅公子 来自
4楼:wufengying
O(∩_∩)O~
5楼:我是龙的传人
7楼:gaojiefeng 来自
8楼:inevermore
9楼:Hadoken00 来自
10楼:hongliuliao
希望早日加星
与内容无关的评论将被删除,严重者禁用帐号
本周热点资讯
本站最新资讯里提到Redis最好还是部署到Linux下去,Windows只是用来做开发环境,现在这个命题发生改变了,在Windows上也可以部署生产环境的Redis,这都要感谢微软的开放,把Redis在Windows上的环境给我们搞定了,最新的版本已经支持64位了。那么Redis在32位上的存储能力受限于可用的地址空间,也就是3GB。 要在Windows上运行64位Redis ,可以从 获取一份Redis代码,然后用Visual Studio 2010 打开\msvs\RedisServer.sln并进行编译。Redis是使用C++写的,所以你安装c++的编译器。
编译好后在msvs\bin\release
把它拷到你想安装的目录,然后把\msvs\RedisWAInst\Samples\ redis.conf 拷过来,具体可参考。
启动服务,可以看到每隔5秒的心跳包输出。
服务端已经运行起来了,现在我们另外起一个命令行终端切换到c:\redis目录下:
说明我们成功运行起来了Redis。备注,你还可以到 去申请一个免费的Redis实例做测试。
在编译的目录下你可以看到另外一个工具RedisWatcher ,这是一个Windows服务,用来启动和监控一个或者多个Redis实例,用上这个工具就可以把Redis作为一个Windows服务来运行。
运行InstallWatcher.msi,默认安装在C:\Program Files\RedisWatcher,修改watcher.conf
把服务启动起来
通过Powershell,你可以查到RedisWatcherSvc已经安装了
我这边继续招人,欢迎大家投简历。 职位信息参看
阅读(...) 评论()Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. J it only takes a minute:
How do I run Redis on Windows? The Redis download page just seems to offer *nix options.
Can I run Redis natively on Windows?
One click Redis install as a Windows service:
Download and run the top .exe (ignore the "download as zip" button)
Edit: For the latest versions of Redis for Windows look at . See
for more information.
54.7k41210252
If you want to install MSOpenTech's latest port of Redis, on a Windows server, watched over by a Windows Service, without having to build anything yourself, read on.
seems to be the only port that is actively trying to keep up with the latest and greatest Redis. They claim it is , but they haven't exactly packaged it up neatly for installation on a server, especially if you want to run their
service to keep an eye on it, which is recommended. (I tried building RedisWatcher myself per their instructions, but the required Wix Toolset managed to mess up my system pretty good. I won't go into it.) Fortunately they've provided all the binaries you need, just not all in one place. From the :
So far the RedisWatcher is not carried over to 2.6. However this
should not be affected by the Redis version, and the code in the 2.4
branch should work with the Redis 2.6 binaries.
So you'll need to download binaries from 2 branches in order to get all the necessary bits. Without further ado, here are the steps:
Download and extract the
Copy all extracted binaries to c:\redis\bin
Create another folder at c:\redis\inst1
Download and extract the
Run InstallWatcher.msi. This should create a Windows service called Redis watcher.
Open up the Windows Services console and start the Redis watcher service.
(optional) RedisWatcher should have installed to C:\Program Files (x86)\RedisWatcher. There you'll find a config file called watcher.conf, which you can edit to set up additional instances, use different paths than I specified in steps 2 & 3, etc. You will not need to restart the service for changes to take effect.
8,51514661
The most updated (only few minor releases behind) version of Redis can be found . This repository provides you with 2.6.12 version (current is 2.6.16) whereas the
gives you only 2.4.6 version and the last update to the repo was 2 years ago.
The installation is straightforward: just copy everything from the archive to any folder and run redis-server.exe to run the server and redis-cli.exe to connect to this server through the shell.
33.1k26162232
and you can get a ZIP file containing the relevant files as well as a Word document called RedisService.docx with the following instructions:
Installing the Service
--service-install
This must be the first argument on the redis-server command line. Arguments after this are passed in the order they occur to Redis when the service is launched. The service will be configured as Autostart and will be launched as "NT AUTHORITY\NetworkService". Upon successful installation a success message will be displayed and Redis will exit.
This command does not start the service.
For instance:
redis-server --service-install redis.windows.conf --loglevel verbose
And then later, in the same document, another example:
The following would install and start three separate instances of Redis as a service:
redis-server --service-install -–service-name redisService1 –port 10001
redis-server --service-start --service-name redisService1
redis-server --service-install --service-name redisService2 –port 10002
redis-server --service-start --service-name redisService2
redis-server --service-install --service-name redisService3 –port 10003
redis-server --service-start --service-name redisService3
From what I can gather, this appears to be the new way forward rather than messing with a separate Windows service to monitor and restart the CLI.
3,81832737
Download redis from
Then install it
open cmd with admin rights
run command net start redis
MS Open Tech recently made a version of Redis available for download on Github.
They say that it isn't production ready yet, but keep an eye on it.
3,30332256
I found one more simple way to install Redis under Windows
Download the latest Redis .msi file from
after installation. The redis service is installed, we can operate it from Service manager
2,92812033
I don't run redis on windows. There's too much hassle involved in keeping up with the ports, and they lag behind redis-stable by a version or two all the time.
Instead I run redis on a
virtual machine that runs redis for me. I've bundled up the whole thing into a simple github
so everyone can get in on the fun without too much hassle. The whole thing is an automated build so there's no mess. I blogged about the details .
25.5k672103
now has links to some unofficial Windows ports. The dmajkic one seems to be the most popular/complete.
More detailed answer:
If you're happy with a bit of Powershell, you can also get very up-to-date Windows binaries using Powershell and chocolatey.
First, add chocolatey to Powershell following the instructions here (one simple command line as admin):
@powershell -NoProfile -ExecutionPolicy unrestricted -Command "iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))" && SET PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin
Then, use Powershell to get the redis package from chocolatey:
choco install redis-64
Redis will be installed in something like C:\ProgramData\chocolatey\lib\redis-64.2.8.9
Windows PowerShell Copyright (C) 2013 Microsoft Corporation. All
rights reserved.
PS C:\windows\system32> choco install redis-64 Chocolatey (v0.9.8.27)
is installing 'redis-64' and dependencies. By installing you accept
the license for 'redis-64' an d each dependency you are installing.
redis-64 v2.8.9 Added
C:\ProgramData\chocolatey\bin\redis-benchmark.exe shim pointed to
'..\lib\redis-64.2.8.9\redis-benchmark.exe'. Added
C:\ProgramData\chocolatey\bin\redis-check-aof.exe shim pointed to
'..\lib\redis-64.2.8.9\redis-check-aof.exe'. Added
C:\ProgramData\chocolatey\bin\redis-check-dump.exe shim pointed to
'..\lib\redis-64.2.8.9\redis-check-dump.exe'. Added
C:\ProgramData\chocolatey\bin\redis-cli.exe shim pointed to
'..\lib\redis-64.2.8.9\redis-cli.exe'. Added
C:\ProgramData\chocolatey\bin\redis-server.exe shim pointed to
'..\lib\redis-64.2.8.9\redis-server.exe'. Finished installing
'redis-64' and dependencies - if errors not shown in console, none
detected. Check log for errors if
Then run the server with
redis-server
Or the CLI with
Follow the instructions in C:\ProgramData\chocolatey\lib\redis-64.2.8.9\RedisService.docx to install the redis service
5,19684591
I think these is the two most simple ways to run Redis on Windows
1 - Native (and updated) port for Windows
As described :
Download the redis64-latest.zip native 64bit Windows port of redis
Extract redis64-latest.zip in any folder, e.g. in c:\redis
Run the redis-server.exe using the local configuration
cd c:\redis
redis-server.exe redis.conf
Run redis-cli.exe to connect to your redis instance
cd c:\redis
redis-cli.exe
2 - With Vagrant
You can use Redis on Windows with Vagrant, as described :
Install Vagrant on Windows
Download the vagrant-redis.zip vagrant configuration
wget /ServiceStack/redis-windows/master/downloads/vagrant-redis.zip
Extract vagrant-redis.zip in any folder, e.g. in c:\vagrant-redis
Launch the Virtual Box VM with vagrant up:
cd c:\vagrant-redis
vagrant up
This will launch a new Ubuntu VM instance inside Virtual Box that will
automatically install and start the latest stable version of redis.
I've provided
for the 2 most popular ways of running Redis on windows at:
that shows how to:
to run the latest stable version of Redis inside a
VirtualBox VM.
Download and run
79.5k9153248
Reading about some users running Redis in a VM, it brought to my mind the recommendations from Redis team :
Redis runs slower on a VM. Virtualization toll is quite high because for many common operations. (...) Prefer to run Redis on a physical box, especially if you favor deterministic latencies. On a state-of-the-art hypervisor (VMWare), result of redis-benchmark on a VM through the physical network is almost divided by 2 compared to the physical machine, with some significant CPU time spent in system and interruptions.
You can try out , which includes redis and also a node.js and mongoDB version manager. And it's cross platform.
To install Redis for Windows
You can choose either from these sources
Personally I prepared the first option
Extract the zip to prepared directory
run redis-server.exe
then run redis-cli.exe
You can start using Redis now please refer for
4,66831937
It seems this is the easiest way to get the latest version of Redis - use NuGet Manager:
1) Open NuGet setup
and download Command-Line Utility
(The latest version of the nuget.exe command-line tool is always available from )
2) Copy this file to somewhere (for example, C:\Downloads)
3) Start a command prompt as an Administrator and execute follow commands:
cd C:\Downloads
nuget.exe install redis-64
4) In the Downloads folder will be the latest version of Redis (C:\Downloads\Redis-64.2.8.19 in my case)
5) Run redis-server.exe and start working
P.S. Note: redis from
contains a very old version of Redis: 2.4.6
3,256131729
Your Answer
Sign up or
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Post as a guest
By posting your answer, you agree to the
Not the answer you're looking for?
Browse other questions tagged
Stack Overflow works best with JavaScript enabled}

我要回帖

更多关于 win10 32支持多大内存 的文章

更多推荐

版权声明:文章内容来源于网络,版权归原作者所有,如有侵权请点击这里与我们联系,我们将及时删除。

点击添加站长微信