2015-05-14 55 views
4

我在Windows上下载了Redis 2.8.19,它运行正常。但之后,我重新启动我的电脑,我尝试打开它,并错误显示:打开Redis服务器时出错

Redis Open server error

【5880】15年5月14日:42:12.227#Redis的Windows版本的分配大内存用于与持久性操作中使用的分叉进程共享堆。该文件将在当前工作目录或.conf文件中'heapdir'指令指定的目录中创建。 Windows正在报告此文件没有足够的磁盘空间可用(Windows错误0x70)。

您可以通过使用--maxheap标志减小Redis堆的大小,或者将堆文件移动到具有足够空间的本地驱动器来解决此问题。有关-maxheap和--heapdir标志的更多详细信息,请参阅二进制发行版附带的文档。

Redis无法继续。退出。

我找不到堆文件,不知道如何减小Redis堆的大小。 谢谢!

回答

6

在fork()的运营总页面文件承诺将最大程度的发挥左右:

(size of physical memory) + (2 * size of maxheap) 

例如,对于物理内存8GB的机器上,最大页面文件提交与默认maxheap大小将为(8)+(2 * 8)GB或24GB。

如果你不给任何提示,Redis的,你得到类似如下的错误:

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. 

为了绕过这个限制,开始Redis的时候指定-maxheap标志,使用值是有关您的机器:

redis-server –-maxheap 1gb 

链接:Installing Redis Cache Locally in a Development Environment

+0

非常感谢很多人在百万答案中的一个,我到处寻找这个你做了我的一天:) :) –

+0

非常感谢:-) – Cristiana214

+1

不要复制粘贴运行字符串。首先有错误' - '。使用这个:'redis-server --maxheap 1gb' – Alexmelyon

0

你可以找到一个名为 “redis.windows.conf” 在Redis的folder.Search文本 “maxheap” 文件,在下一行插入“maxheap 1024000000”(或者你可以设置超过1024000000)。修改文件后重新启动redis服务器。