Windows下安装和配置低版本的redis,百度可得的资料比较少,最后还是通过google找到了一篇英文版的安装方法介绍,内容详见地址。我将上述过程进行记录,亦算是当一回翻译(辣鸡英语水平).
一、Windows下redis2.8.12资源准备
1、资源下载地址
点击下载
2、解压压缩包,在redis-win2.8.12\bin\release目录下有一个已经编译好的redis的可执行程序,将其拷贝至C盘并解压,内容如下:
二、安装过程
1、首次启动redis-server
redis-server redis.windows.conf
此时会报错,内容如下:
C:\redis2.8>redis-server.exe redis.windows.conf
[5052] 05 Apr 08:46:51.118 #
The Windows version of Redis allocates a memory mapped heap for sharing with
the forked process used for persistence operations. In order to share this
memory, Windows allocates from the system paging file a portion equal to the
size of the Redis heap. At this time there is insufficient contiguous free
space available in the system paging file for this operation (Windows error
0x5AF). To work around this you may either increase the size of the system
paging file, or decrease the size of the Redis heap with the --maxheap flag.
Sometimes a reboot will defragment the system paging file sufficiently for
this operation to complete successfully.
Please see the documentation included with the binary distributions for more
details on the --maxheap flag.
Redis can not continue. Exiting.
参考上述文档,对redis.windows.conf进行修改,在“maxheap ”处添加如下配置:
# maxheap <bytes>
maxheap 1024000000
再次启动redis-server
redis-sever已正常启动,创建启动脚本
startup.bat
redis-server.exe redis.windows.conf
2、将redis-server添加为系统服务
service-install.bat
redis-server.exe --service-install redis.windows.conf --loglevel verbose
uninstall-service.bat
redis-server --service-uninstall
3、测试redis-server
C:\>redis-cli
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
"quit" to exit
127.0.0.1:6379>