本地计算机上的redis服务停止某些服务,windows版redis报错:本地计算机上的Redis服务启动后停止...

redis有windows版和linux版的,本文讲的是windows版相关的一些问题。

1、问题

使用命令redis-server.exe   --service-install   redis.windows.conf命令将redis注册为服务,启动服务时报错:

本地计算机上的Redis服务启动后停止。某些服务在未由其他服务或程序使用时将自动停止。

使用命令redis-server.exe   redis.windows.conf临时安装redis,结果报错:

The Windows version of Redis allocates a memory mapped heap forsharing with

the forked process used for persistenceoperations. In order to share this

memory, Windows allocates from the systempaging file a portion equal to the

size of the Redis heap. At this time thereis insufficient contiguous free

space available in the system paging filefor this operation (Windows error

0x5AF). To work around this you may eitherincrease the size of the system

paging file, or decrease the size of theRedis heap with the --maxheap flag.

Sometimes a reboot will defragment thesystem paging file sufficiently for

this operation to complete successfully.

Please see the documentation included withthe binary distributions for more

details on the --maxheap flag.

Redis can not continue. Exiting.

如图:

8b7334819a361eae5b4294ef45252fe9.png

2、原因

由于没有指定maxheap导致的,当然了不指定该参数不一定报错,但是出现上述原因,通常是这个原因导致的。

3、解决

3.1、如果需要临时启动Redis

使用命令:redis-server.exe   redis.windows.conf   --maxheap 200m

说明:200m是指定最大堆内存是200m,当然你也可以修改得在大一些

3.2、如果需要将Redis注册为服务

如果已经注册为了服务,先卸载掉,卸载方法是,用cmd进入到你的redis文件的目录,然后执行命令:

redis-server     --service-uninstall

卸载完成后,重新安装服务,执行命令:

redis-server.exe   --service-install   redis.windows.conf    --maxheap  200m

说明:200m是指定最大堆内存是200m,当然你也可以修改得在大一些

4、其他说明

可以到github上下载最新版的redis

地址是:

windows系统的话,可以下载msi版直接安装,我这里下载的是zip版,自己执行命令来安装

如图:

b0b5a8eac942792e08fb44717b20fa2d.png

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值