在Windows上运行Redis作为服务

时间:2014-12-24 16:38:59

标签: windows service redis

我已经遵循了我能找到的所有建议 我在Windows 2008上运行redis上的当前版本 我可以从命令行运行fin 我可以安装该服务,但它没有运行

我做...... redis-server --service-install redis.windows.conf 并将“redis成功安装为服务”

然后我尝试启动服务...... redis-server --service-start redis.windows.conf --loglevel verbose 并使Redis服务无法启动

我已经确定安装了.net framework 4.5.2,我已经尝试关闭防火墙,并在文件夹中使用了安全性。

有人有什么想法吗?

(圣诞快乐)

3 个答案:

答案 0 :(得分:15)

从命令行而不是作为服务启动redis服务器,它将显示更有用的错误消息。如果您只是使用默认配置,则很可能是maxmemory / maxheap配置存在问题。

C:\redis>redis-server.exe redis.windows.conf
[1576] 04 Feb 10:32:54.172 #
The Windows version of Redis allocates a memory mapped heap for sharing with
the forked process used for persistence operations. In order to share this
memory, Windows allocates from the system paging file a portion equal to the
size of the Redis heap. At this time there is insufficient contiguous free
space available in the system paging file for this operation (Windows error
0x5AF). To work around this you may either increase the size of the system
paging file, or decrease the size of the Redis heap with the --maxheap flag.
Sometimes a reboot will defragment the system paging file sufficiently for
this operation to complete successfully.

Please see the documentation included with the binary distributions for more
details on the --maxheap flag.

Redis can not continue. Exiting.

答案 1 :(得分:8)

在我的情况下,默认命令行配置没有启用日志记录而服务器没有。并没有它抱怨的地方。 尝试创建目录./Logs。

答案 2 :(得分:2)

老问题,但我在尝试使用二进制文件Redis-x64-2.8.2101进行Win7x64安装时遇到了它。尽管摆弄了各种选项,但是在使用配置运行时没有给出有意义的错误,并且在本机运行时只有明显虚假的磁盘空间错误,无法启动它。

github上似乎存在一个问题,链接在这里以便将来获益:https://github.com/MSOpenTech/redis/issues/267