Redis無法啟動You may fix this problem by either reducing the size of the Redis heap with the --maxheap

來源:互聯網
上載者:User

標籤:redis   無法啟動   maxheap   最大堆   conf   

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無法啟動You may fix this problem by either reducing the size of the Redis heap with the --maxheap

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.