Win64UnofficialThe 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文件夹下有下面这些文件:
D:\Develop\redis-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
maxheap 1024000000
.......然后再次启动,OK,成功.
D:\Develop\redis-2.8.12>redis-server redis.windows.conf
_._
_.-``__ ''-._
_.-`` `. `_. ''-._ 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
然后能够使用自带的client工具进行測试。
双击打开 redis-cli.exe , 假设不报错,则连接上了本地服务器,然后測试,比方 set命令,get命令:
127.0.0.1:6379> set tiemao http://blog.iyunv.com/renfufei
OK
127.0.0.1:6379> get tiemao
"http://blog.iyunv.com/renfufei"
127.0.0.1:6379>这应该非常好理解,连接上了本机的6379端口。
假设须要帮助,能够在 cli窗体中输入 help查看,比如:
127.0.0.1:6379> help
redis-cli 2.8.12
Type: "help @" to get a list of commands in
"help " for help on
"help " to get a list of possible help topics
"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下使用,请轻拍。
我在这个群里,该群有大量高手潜伏,欢迎增加: 点击链接增加群【redis两千人总群】