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

本文涉及的产品
云数据库 Redis 版,社区版 2GB
推荐场景:
搭建游戏排行榜
简介: 1问题2 原因3解决3.1 如果需要临时启动Redis3.2 如果需要将Redis注册为服务4其他说明1、问题使用命令redis-server.exe  --service-install redis.windows.conf命令将redis注册为服务,启动服务时报错:本地计算机上的Redis服务启动后停止。

1问题

2 原因

3解决

3.1 如果需要临时启动Redis

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

4其他说明

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.

如图:


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

地址是:

https://github.com/MSOpenTech/redis/releases

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

如图


启动redis出现Creating Server TCP listening socket *:6379: bind: No such file or directory

Redis报错:

[6644] 02 Apr 23:11:58.976 # Creating Server TCP listening socket *:6379: bind: No such file or directory

的解决方案如下按顺序输入如下命令就可以连接成功

1. redis-cli.exe

2. shutdown

3. exit

4. redis-server.exe redis.windows.conf

相关实践学习
基于Redis实现在线游戏积分排行榜
本场景将介绍如何基于Redis数据库实现在线游戏中的游戏玩家积分排行榜功能。
云数据库 Redis 版使用教程
云数据库Redis版是兼容Redis协议标准的、提供持久化的内存数据库服务,基于高可靠双机热备架构及可无缝扩展的集群架构,满足高读写性能场景及容量需弹性变配的业务需求。 产品详情:https://www.aliyun.com/product/kvstore     ------------------------------------------------------------------------- 阿里云数据库体验:数据库上云实战 开发者云会免费提供一台带自建MySQL的源数据库 ECS 实例和一台目标数据库 RDS实例。跟着指引,您可以一步步实现将ECS自建数据库迁移到目标数据库RDS。 点击下方链接,领取免费ECS&RDS资源,30分钟完成数据库上云实战!https://developer.aliyun.com/adc/scenario/51eefbd1894e42f6bb9acacadd3f9121?spm=a2c6h.13788135.J_3257954370.9.4ba85f24utseFl
目录
相关文章
|
1月前
|
Linux Shell Windows
通过Linux挂载Windows端NFS服务实现板端Linux传输文件到PC
通过Linux挂载Windows端NFS服务实现板端Linux传输文件到PC
|
1月前
|
NoSQL 网络安全 Redis
用Windows连接Liunx中的redis
用Windows连接Liunx中的redis
23 0
|
1月前
|
存储 安全 数据安全/隐私保护
Windows部署WebDAV服务并映射到本地盘符实现公网访问本地存储文件
Windows部署WebDAV服务并映射到本地盘符实现公网访问本地存储文件
249 0
|
2月前
|
Java Unix 应用服务中间件
使用java service wrapper把windows flume做成服务
使用java service wrapper把windows flume做成服务
|
21天前
|
Shell Windows
Windows服务器 开机自启动服务
Windows服务器 开机自启动服务
13 0
|
7天前
|
Windows
【报错】在浏览器输入localhost为什么启动的是Microsoft的IIS windows首页?
【报错】在浏览器输入localhost为什么启动的是Microsoft的IIS windows首页?
|
7天前
|
应用服务中间件 nginx Windows
【报错】Windows下启动nginx报:bind() to 0.0.0.0:80 failed...
【报错】Windows下启动nginx报:bind() to 0.0.0.0:80 failed...
|
30天前
|
NoSQL Java 应用服务中间件
使用innoSetup将mysql+nginx+redis+jar包打包成windows安装包
使用innoSetup将mysql+nginx+redis+jar包打包成windows安装包
使用innoSetup将mysql+nginx+redis+jar包打包成windows安装包
|
1月前
|
Windows
windows server 2019 安装NET Framework 3.5失败,提示:“安装一个或多个角色、角色服务或功能失败” 解决方案
windows server 2019 安装NET Framework 3.5失败,提示:“安装一个或多个角色、角色服务或功能失败” 解决方案
|
2月前
|
NoSQL 关系型数据库 MySQL
Windows、Linux、Mac安装数据库(mysql、MongoDB、Redis)#0
不同系统下进行MySQL安装、MongoDB安装、Redis安装【2月更文挑战第5天】
440 5
Windows、Linux、Mac安装数据库(mysql、MongoDB、Redis)#0

热门文章

最新文章