windows下安装并启动redis服务

有时候客户环境是windows系统,但是我们的项目又用redis,那么就需要下载windows版本的redis来安装使用。

下载地址: http://redis.io/download


下载解压后,打开Windows Service Documentation.docx,里面有详细的命令:

安装服务:

redis-server --service-install redis.windows.conf--loglevel verbose

卸载服务:

redis-server --service-uninstall


启动服务:

redis-server.exe --service-start

停止服务:

redis-server.exe --service-stop


关于启动服务这一步,有可能会报错:

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.


出现这个错误,多半是由于没有在conf文件中配置maxheap导致。

在redis.windows.conf中找到 # maxheap <bytes>,在下面添加配置 maxheap xxxxxx

再启动,如果报no such file or directory, 则应该是没有创建heap文件的目录:

heapdir D:/temp/redis_heapdir/

创建目录即可。


另:建议按照文档指令来操作,否则可能会出现各种奇怪问题,比如启动报错、停止报错,但是实际上已经起来(停止)了。


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值