Redis服务在Windows中启动后立即停止

3

我正在尝试在Windows Server 2008中运行Redis https://msopentech.com/opentech-projects/redis/

我已经在多台机器上安装了它,所有机器都正常工作。 我还尝试使用许多登录账户:管理员账户、本地系统、网络服务,但都无法工作。

我得到的确切消息是:

The Redis service on Local Computer started and then stopped.
Some services stop automatically if they are not in use by other services or programs.

我也尝试从命令行启动服务,但是我得到的只有:

[3472] 27 Jul 17:51:45.375 # Redis service failed to start.

事件查看器中没有日志。


Redis 可执行文件所在的驱动器上有多少磁盘空间?服务的确切命令行是什么? - Philip P.
我正在尝试使用以下命令启动它:redis-server --service-start。而且它大约有20GB的大小。 - davibq
可能是因为磁盘空间不足导致程序运行失败。那些能正常运行的机器,它们的磁盘空间更多吗?您可以尝试使用更大的磁盘安装或运行程序吗? - Philip P.
非常感谢您,同志。我没有足够的磁盘空间。您确实指引了我正确的方向。此外,这篇帖子也对我有很大帮助:https://dev59.com/v14b5IYBdhLWcg3wxEGm - davibq
我正在使用Windows,我遇到了同样的问题。安装后,我进行了系统重启,Redis自动启动,一切都很顺利。 - Abilash Arjunan
1个回答

7
Redis由于存储问题而无法启动,正如Komrade P在评论中指出的那样。 我的硬盘只有16GB可用空间和8GB内存。根据Redis的要求,在8GB内存下,您需要24GB的磁盘空间。 我更改了maxheap、heapdir和maxmemory的值以使其正常工作。 基本上我的问题在配置文件中有所解释。
# *** There must be disk space available for this file in order for Redis 
# to launch. *** The default configuration places this file in the local 
# appdata directory. If you wish to move this file to another local disk,
# use the heapdir flag as described below.

# 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.

对我来说,我只是在配置文件中将 heapdir 更改为“heapdir heap”,并在 redis 解压时创建了一个名为“heap”的目录。 - TugboatCaptain
我在配置文件中找不到 maxheap。是否有参数可以设置启动所需的 RAM,然后根据需要消耗? - bjan
通过在除了redis安装驱动器之外的驱动器上创建一个具有足够空闲空间的新目录,并在heapdir中提到它,再使用命令redis-server.exe redis.windows.conf重新启动redis,已经解决了这个问题。 - Sandeepan Nath

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