转载于:http://www.itxuexiwang.com/a/shujukujishu/redis/2016/0216/104.html?1455868495

Redis对于Linux​是官方支持的,安装和使用没有什么好说的,普通使用按照官方指导,5分钟以内就能搞定。详情请参考: http://redis.io/download

但有时候又想在windows下折腾下Redis,可以从redis下载页面看到如下提示:

代码如下:

Win64 Unofficial The Redis project does not directly support Windows, 
 however the Microsoft Open Tech group develops and maintains 
 an Windows port targeting Win64.

大意就是 Redis官方是不支持windows的,只是 Microsoft Open Tech group 在 GitHub上开发了一个Win64的版本,项目地址是: https://github.com/MSOpenTech/redis

打开以后,可以直接使用浏览器下载,或者git克隆。

可以在项目主页右边找到 zip包下载地址: https://github.com/MSOpenTech/redis/archive/2.8.zip

下载解压,没什么好说的,在解压后的bin目录下有以下这些文件:

代码如下:

redis-benchmark.exe         #基准测试
redis-check-aof.exe         # aof
redis-check-dump.exe        # dump
redis-cli.exe               # 客户端
redis-server.exe            # 服务器
redis.windows.conf          # 配置文件

当然,还有一个 RedisService.docx 文件,看似是一些启动和安装服务的说明文档,但是照着他的指示来,你就会死的很惨,莫名其妙的死了,不知道原因。
【换机器重新测试后已查明,如果不是Administrator用户,就会出各种问题,服务安装以后启动不了等等问题,应该可以修改服务的属性-->登录用户等选项来修正.】

【如果你安装的windows没有Administrator账户,请参考这篇文章: Windows 7 启用超级管理员administrator账户的N种方法 】

网上参考了一些资料,发觉可以使用,也就没有深究,直接拿来主义:#p#分页标题#e#

启动脚本如下:

代码如下:

redis-server  redis.windows.conf

可以将其保存为文件 startup.bat ; 下次就可以直接启动了。
但是在cmd之中执行这行命令之后报错:

代码如下:

D:Developredis-2.8.12>redis-server.exe redis.windows.conf
[7736] 10 Aug 21:39:42.974 #
The Windows version of Redis allocates a large memory mapped file for sharing
the heap with the forked process used in persistence operations. This file
will be created in the current working directory or the directory specified by
the 'dir' directive in the .conf file. Windows is reporting that there is
insufficient disk space available for this file (Windows error 0x70).

You may fix this problem by either reducing the size of the Redis heap with
the --maxheap flag, or by starting redis from a working directory with
sufficient space available for the Redis heap.

Please see the documentation included with the binary distributions for more
details on the --maxheap flag.

Redis can not continue. Exiting.

根据提示,是 maxheap 标识有问题,打开配置文件 redis.windows.conf ,搜索 maxheap , 然后直接指定好内容即可.

代码如下:

.......
#  
# maxheap <bytes>
maxheap 1024000000
.......

然后再次启动,OK,成功.

代码如下:

D:Developredis-2.8.12>redis-server  redis.windows.conf
                _._#p#分页标题#e#
           _.-``__ ''-._
      _.-``    `.  `_.  ''-._           Redis 2.8.12 (00000000/0) 64 bit
  .-`` .-```.  ```/    _.,_ ''-._
 (    '      ,       .-`  | `,    )     Running in stand alone mode
 |`-._`-...-` __...-.``-._|'` _.-'|     Port: 6379
 |    `-._   `._    /     _.-'    |     PID: 6736
  `-._    `-._  `-./  _.-'    _.-'
 |`-._`-._    `-.__.-'    _.-'_.-'|
 |    `-._`-._        _.-'_.-'    |           http://redis.io
  `-._    `-._`-.__.-'_.-'    _.-'
 |`-._`-._    `-.__.-'    _.-'_.-'|
 |    `-._`-._        _.-'_.-'    |
  `-._    `-._`-.__.-'_.-'    _.-'
      `-._    `-.__.-'    _.-'
          `-._        _.-'
              `-.__.-'

[6736] 10 Aug 22:01:22.247 # Server started, Redis version 2.8.12
[6736] 10 Aug 22:01:22.248 * The server is now ready to accept connections on port 6379

然后可以使用自带的客户端工具进行测试。
双击打开 redis-cli.exe , 如果不报错,则连接上了本地服务器,然后测试,比如 set命令,get命令:

代码如下:

127.0.0.1:6379> set tiemao http://www.jb51.net 
OK
127.0.0.1:6379> get tiemao
" http://www.jb51.net "
127.0.0.1:6379>

这应该很好理解,连接上了本机的6379端口。

如果需要帮助,可以在 cli窗口中输入 help查看,例如:

代码如下:

127.0.0.1:6379> help
redis-cli 2.8.12
Type: "help @<group>" to get a list of commands in <group>
      "help <command>" for help on <command>
      "help <tab>" to get a list of possible help topics#p#分页标题#e#
      "quit" to exit
127.0.0.1:6379> help @string

根据提示,可以输入 help 空格 然后敲tab键,可以像命令提示一样告诉你可以有哪些帮助分组,多敲几个 tab 试试?
备注说明:

1. 这个版本是Win64的,所以32位windows就不要折腾了。

2. 我的操作系统是Windows 7 64位旗舰版,运行内存16GB,用户不是Administrator,而是 hasee,所以设置了下 redis-server.exe 和redis-cli.exe 的属性中的兼容性权限(以管理员身份运行),如果你运行出错,可能需要设置一下这里。

3. 什么360啊,UAC啊,防火墙啊,该关的请关闭。。。

4. 如果有其他问题,欢迎留言或者评论, 这只是一个心血来潮时的折腾

接触了好久Redis但一直没在windows下使用,请轻拍

64位Windows下安装Redis教程的更多相关文章

  1. Windows下安装Redis及php的redis拓展教程

    一.安装前必读 Windows 64位操作系统 Redis 安装包(版本3.0.5,截止2017-05-29最新redis版本为3.2.9) 注意事项: 1.在window下如果你还需安装php的re ...

  2. Windows下安装Redis

    1.首先,Redis官方是支持Linux系统的,我这里不多说,需要的可以参考:http://www.oschina.net/question/12_18065/ 2.Windows 64位下载地址:h ...

  3. 【Oracle】在WIN NT 64位环境下安装win64_11gR2_database。并用PL/SQL连接

    因为现在大多数服务器环境均为64位环境,而且有一部分使用的windows server的环境,在此做了一番小研究,如何在64位环境下安装oracle11g_64bit服务端 (1)首先www.orac ...

  4. Windows下安装redis,并与PHP使用

    一.在windows下安装redis: redis的官方网站下载地址:http://redis.io/download 进入以上网址之后,请见以下的图片操作下载redis: 第一步: 第二步:在对应的 ...

  5. Winio驱动在64位windows下无法使用的解决方法

    C#在使用WinIo的驱动开发类似按键精灵一类工具的时候,需要对相关的驱动进行注册才能正常启动,找了下资料,资料来自: http://jingyan.baidu.com/article/642c9d3 ...

  6. PyTorch在64位Windows下的Conda包(转载)

    PyTorch在64位Windows下的Conda包 昨天发了一篇PyTorch在64位Windows下的编译过程的文章,有朋友觉得能不能发个包,这样就不用折腾了.于是,这个包就诞生了.感谢@晴天14 ...

  7. 64位ubuntu下安装微博客户端的方法

    最近安装了12.04的ubuntu系统,在unbutu提供的软件中心找不到微博客户端的应用,但在新浪的http://sinatair.sinaapp.com/下找到了官方的客户端. 于是下载了linu ...

  8. 在64位windows下使用instsrv.exe和srvany.exe创建windows服务

    在64位windows下使用instsrv.exe和srvany.exe创建windows服务   在32位的windows下,包括windows7,windows xp以及windows 2003, ...

  9. <转>windows下安装redis

    1.redis简介redis是一个key-value存储系统.和Memcached类似,它支持存储的value类型相对更多,包括string(字符串).list(链表).set(集合).zset(so ...

随机推荐

  1. 在虚拟机上安装Linux6.5

    下定决心开始学习Linux了,这个博客将记录我的成长点滴,方便日后温故而知新!并希望有小伙伴能给出意见和建议! 我用的是VMware Workstation 10,当然是破解版,毕竟只是自己做练习使用 ...

  2. flask_单元测试

    我们现在可以试着在控制台向数据库添加一个用户: In[2]: import model; In[3]: from microblog import db; In[4]: u=model.User(ni ...

  3. mysql下载安装

    1.下载 下载地址:http://dev.mysql.com/downloads/mysql/ 根据电脑配置来选,我选了 windows(x86,64-bit),ZIP Archive这个,点击Dow ...

  4. Swift语法简介(一)

    或许网络上有很多成型的介绍,我只想写下来留给自己.欢迎批评.开撸! 1.第一个程序,Hello,world!古人云,学会了Hello,world!这门语言你就掌握了一半了. print("H ...

  5. 【Visual Lisp】两种出错处理方式

    两种出错处理方式:一种是对出错函数进行重定义,一种是对错误进行捕捉处理. ;;============================================================= ...

  6. javascript中array常用属性方法

    属性: length 表示一个无符号 32-bit 整数,返回一个数组中的元素个数. 截短数组..截短至长度2  则:   .length = 2 方法: Array.from() 方法可以将一个类数 ...

  7. Java数组与vector互转

    Java数组与vector互转 /* Object[] object1 = null ; //数组定义 Vector<Object> object2;//Vector定义 object2 ...

  8. 简单BigDecimal运算精度

    项目中遇到了数值运算,如网上所写的,一般有这几个方法: /** * 提供精确的加法运算. * @param v1 被加数 * @param v2 加数 * @return 两个参数的和 */ publ ...

  9. jquery事件委托遇到的小坑记录

    <script type="text/javascript" src="../../lib/jquery-1.11.2.min.js"></s ...

  10. 给VM中的RHEL6.5配置本地源

    二步:1.启动时自动挂载安装盘:2.增加一个".repo"(或者改掉原来的源的配置p.s.除非你以后都不想用网络源或者已经知道如何更改源的配置,否则别改) 首先,在/media中创 ...