Redis官网下载:
默认不支持 windows版本,windows版本:https://github.com/ServiceStack/redis-windows
解压:D:\redis
redis-benchmark.exe #基准测试
redis-check-aof.exe # aof
redis-check-dump.exe # dump
redis-cli.exe # 客户端
redis-server.exe # 服务器
redis.windows.conf # 配置文件
命令行管理员权限运行:redis-server redis.windows.conf
如果出现错误:
D:\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.
打开配置文件 redis.windows.conf ,搜索 maxheap , 然后直接添加内容即可.
.......
#
# maxheap <bytes>
maxheap 1024000000
.......
运行:
双击打开 redis-cli.exe , 如果不报错,则连接上了本地服务器,然后测试,比如 set命令,get命令。
bat 批处理脚本,请根据需要灵活配置:
service-install.bat:
redis-server.exe --service-install redis.windows.conf --loglevel verbose
uninstall-service.bat:
redis-server --service-uninstall
startup.bat:
redis-server.exe redis.windows.conf