2015-05-14 57 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服務器。