gpt4 book ai didi

powershell - Redis 服务器不能运行超过 1024M 的 maxheap

转载 作者:IT王子 更新时间:2023-10-28 23:30:06 28 4
gpt4 key购买 nike

我在 Windows Server 2008 上运行 Redis 2.8.19。我收到一条错误消息,指出我的 Redis 堆的磁盘空间不足。 (内存映射文件而不是 fork())。

如果我在 cfg 中有“maxheap 1024M”,我只能让 Redis 运行,即使我已将“heapdir”设置为的目录上有大约 50GB 的可用空间。

如果我尝试使用更高的 maxheap 或没有 maxheap 运行它,我会收到此错误 (PowerShell):

PS C:\Users\admasgve> cd D:\redis-2.8.19

PS D:\redis-2.8.19> .\redis-server.exe

[7476] 25 Feb 09:32:38.419 # 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.

截图:http://i.stack.imgur.com/Xae0f.jpg

  • D 上的可用空间:49.4 GB
  • C 上的可用空间:2.71 GB
  • 总内存:16 GB
  • 可用内存:~9 GB

redis.windows.conf:

# Generated by CONFIG REWRITE
loglevel verbose
logfile "stdout"
save 900 1
save 300 10
save 60 10000
dir "D:\\redis-2.8.19"
maxmemory 1024M
# maxheap 2048M
heapdir "D:\\redis-2.8.19"

最后 3 行之外的所有内容都是由 redis 使用 'CONFIG REWRITE' cmd 生成的。我尝试了各种方法,包括 maxmemory、maxheap 和 heapdir。

来自 Redis 文档:

maxmemory / maxheap - the maxheap flag controls the maximum size of this memory mapped file, as well as the total usable space for the Redis heap. Running Redis without either maxheap or maxmemory will result in a memory mapped file being created that is equal to the size of physical memory; The Redis heap must be larger than the value specified by the maxmemory

以前有人遇到过这个问题吗?我做错了什么?

最佳答案

默认情况下,Redis 不使用其主目录中的 conf 文件。您必须在命令行中传递文件:

.\redis-server.exe redis.windows.conf

这是我的 conf 文件中的内容:

maxheap 2048M
heapdir D:\\redisheap

这些设置解决了我的问题。

关于powershell - Redis 服务器不能运行超过 1024M 的 maxheap,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28714957/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com