Redis服务无法在Windows上启动。

3
当我尝试启动Redis服务时,我一直收到这个错误消息:“本地计算机上的Redis服务已启动,然后停止。如果某些服务未被其他服务或程序使用,则会自动停止”。

enter image description here

唯一有效的方法就是重新启动电脑,然后redis服务会在启动时运行。 我需要设置任何配置才能让它更好地工作吗? 我使用.msi安装了redis,版本为2.8.2104。 非常感谢所有的帮助!谢谢。

1
在 Windows 中检查事件查看器时,我发现它抱怨没有磁盘空间,其他人也遇到了类似的错误。解决方案是在 conf 文件中设置 maxheap 设置。我将其设置为 2GB,然后它开始正常工作! - Gustav
3个回答

3

在Windows服务中右键点击该服务并进入Properties。然后转到Log On选项卡,并选择本地系统帐户。单击Ok按钮并启动服务。


1

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

我们正在运行的机器(TEST)只有驱动器上的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
@bjan,redis.windows.conf文件位于Redis的根目录中。但是,我承认我没有在那个服务器上安装Redis,所以可能是其他人手动创建了该文件。我相信你只需要这5个exe文件和一个配置文件就可以了。你应该能够在网上找到一个示例配置文件。 - cbmeeks
我曾尝试安装多个 Redis 实例(MSOpenTech 版本),但失败了,于是我使用了旧版本。 - bjan

0

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


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接