Redis无法启动You may fix this problem by either reducing the size of the Redis heap with the --maxheap

本文涉及的产品
云数据库 Redis 版,社区版 2GB
推荐场景:
搭建游戏排行榜
简介: Redis无法启动 今天在启动Redis时提示以下错: C:\Java\redis2817>redis-server.exe redis.windows.conf [5268] 23 Apr 11:45:22.

Redis无法启动
今天在启动Redis时提示以下错:
C:\Java\redis2817>redis-server.exe redis.windows.conf
[5268] 23 Apr 11:45:22.696 #
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 ‘heapdir’ 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 moving the heap file to a local drive with sufficient
space.
Please see the documentation included with the binary distributions for more
details on the –maxheap and –heapdir flags.

Redis can not continue. Exiting.
原因分析:
经过分析,原来是最大堆大小“maxheap ”配置的问题,是因为可用的内存不足,不 能满足maxheap配置的条件,所以无法启动。

解决办法:
打开Redis的配置文件“redis.windows.conf”,找到以下代码部分:

# The Redis heap must be larger than the value specified by the maxmemory 
# flag, as the heap allocator has its own memory requirements and 
# fragmentation of the heap is inevitable. If only the maxmemory flag is 
# specified, maxheap will be set at 1.5*maxmemory. If the maxheap flag is 
# specified along with maxmemory, the maxheap flag will be automatically 
# increased if it is smaller than 1.5*maxmemory. 
#  
# maxheap <bytes>
maxheap 51200000

默认的值是:maxheap 1024000000,
我这因为剩余可用的内存太小了,
所以将其改为:maxheap 51200000,终于可以启动了。

相关实践学习
基于Redis实现在线游戏积分排行榜
本场景将介绍如何基于Redis数据库实现在线游戏中的游戏玩家积分排行榜功能。
云数据库 Redis 版使用教程
云数据库Redis版是兼容Redis协议标准的、提供持久化的内存数据库服务,基于高可靠双机热备架构及可无缝扩展的集群架构,满足高读写性能场景及容量需弹性变配的业务需求。 产品详情:https://www.aliyun.com/product/kvstore &nbsp; &nbsp; ------------------------------------------------------------------------- 阿里云数据库体验:数据库上云实战 开发者云会免费提供一台带自建MySQL的源数据库&nbsp;ECS 实例和一台目标数据库&nbsp;RDS实例。跟着指引,您可以一步步实现将ECS自建数据库迁移到目标数据库RDS。 点击下方链接,领取免费ECS&amp;RDS资源,30分钟完成数据库上云实战!https://developer.aliyun.com/adc/scenario/51eefbd1894e42f6bb9acacadd3f9121?spm=a2c6h.13788135.J_3257954370.9.4ba85f24utseFl
目录
相关文章
|
8天前
|
缓存 NoSQL 中间件
redis内存溢出报错--OOM command not allowed when used memory > 'maxmemory'
该内容是关于Redis缓存服务器的使用指南。通过Xshell连接IP地址为25.218.153.193或206的主机,进入/data/iuap/middleware/redis-30001/bin目录,使用`redis-cli`连接到IP为206的30003端口。登录时需`auth yonyou*123`,可运行`info`和`info memory`查看状态,`flushall`清理缓存。在清理前,要备份/data/iuap/middleware/redis-30003/data/下的.aof和.rdb文件,利用tar命令打包并移至/tmp目录。
|
5月前
|
NoSQL Redis 开发工具
redis WARNING overcommit_memory is set to 0 问题解决方法
redis WARNING overcommit_memory is set to 0 问题解决方法
|
6月前
|
缓存 NoSQL 算法
Redis之MoreKey问题及Scan命令解读
Redis之MoreKey问题及Scan命令解读
|
NoSQL Java 程序员
Redis scan 命令的一次坑
Redis scan 命令的一次坑
275 0
|
存储 NoSQL Java
解决 MISCONF Redis is configured to save RDB snapshots 异常详解
解决 MISCONF Redis is configured to save RDB snapshots 异常详解
958 0
解决 MISCONF Redis is configured to save RDB snapshots 异常详解
|
NoSQL Redis
Redis的scan命令学习
Redis的scan命令学习
182 0
|
NoSQL Java Redis
Redis集群:gem_original_require: no such file to load -- redis
Redis集群:gem_original_require: no such file to load -- redis
109 0
|
缓存 NoSQL Java
解决Redis报错Redis is configured to save RDB snapshots, but it is currently not able to persist on disk
解决Redis报错Redis is configured to save RDB snapshots, but it is currently not able to persist on disk
1745 0
|
NoSQL Redis Memcache
Redis vs. Memcached: In-Memory Data Storage Systems
Redis and Memcached are both in-memory data storage systems. Memcached is a high-performance distributed memory cache service, and Redis is an open-source key-value store.
1926 0
Redis vs. Memcached: In-Memory Data Storage Systems