【问题标题】:Redis service won't start on windowsRedis 服务无法在 Windows 上启动
【发布时间】:2015-10-27 13:57:10
【问题描述】:

当我尝试启动 redis 服务时,我不断收到此错误:

“本地计算机上的 Redis 服务启动然后停止。如果某些服务没有被其他服务或程序使用,它们会自动停止”。

唯一有效的方法是重新启动我的计算机,然后 redis 服务在启动时运行。 是否需要设置任何配置才能使其更好地工作? 我使用 .msi 安装了 redis,版本 2.8.2104。

所有帮助将不胜感激!谢谢

【问题讨论】:

  • 在 Windows 中检查事件查看器时,我发现它抱怨没有磁盘空间,其他人也有类似的错误。解决方案是在 conf 文件中设置 maxheap 设置。我将它设置为 2gb,它开始工作正常!

标签: windows-7 redis windows-services


【解决方案1】:

右键单击窗口服务中的服务并转到属性。然后转到登录选项卡并选择本地系统帐户。单击确定按钮并启动服务。

【讨论】:

    【解决方案2】:

    对于那些可能有类似问题的人(就像我们一样),我找到了另一种解决方案。

    我们正在运行的机器(测试)在驱动器上只有7GB 的可用空间。但我们有16GB 的 RAM。在我们的redis.windows.conf 文件中,有一个名为maxheap 的设置未被设置。

    根据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. During 
    # fork() operations the total page file commit will max out at around:
    #
    #    (size of physical memory) + (2 * size of maxheap)
    #
    # For instance, on a machine with 8GB of physical RAM, the max page file 
    # commit with the default maxheap size will be (8)+(2*8) GB , or 24GB. The
    # default page file sizing of Windows will allow for this without having 
    # to reconfigure the system. Larger heap sizes are possible, but the maximum
    # page file size will have to be increased accordingly.
    # 
    # 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>
    

    所以我将它设置为一个合理的值并且服务立即启动。

    【讨论】:

    • 我遇到了同样的问题,即 Redis 服务没有启动,甚至另一个服务也没有停止并且没有文件名redis.windows.conf。有什么建议吗?
    • @bjan redis.windows.conf 文件位于 Redis 的根文件夹中。但是,我承认我没有在该服务器上安装 Redis,因此其他人可能手动创建了该文件。我相信您所需要的只是 5 个exe 文件和一个配置。您应该能够在线找到示例配置文件。
    • 我试图安装多个 Redis 实例(MSOpenTech 版本)但我失败了,然后我使用了旧版本。
    【解决方案3】:

    我在配置 (ini) 上发现了一个读写错误 请检查 INI 上指定的所有文件和目录。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-11-22
      • 1970-01-01
      • 2022-01-24
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多