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).redis
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.windows
Redis can not continue. Exiting.
緣由分析:
通過分析,原來是最大堆大小「maxheap 」配置的問題,是由於可用的內存不足,不 能知足maxheap配置的條件,因此沒法啓動。app
解決辦法:
打開Redis的配置文件「redis.windows.conf」,找到如下代碼部分:ui
# 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,終於能夠啓動了。this