开发者社区> 问答> 正文

关于redis在windows平台下的单机多实例的问题?报错

使用redis的windwos 64位2.8.17的版本

但只运行一个实例的时候一切都OK可以正常运行

但如果要运行2个实例的时候,第二个启动的实例报错如下:

[2684] 13 Oct 15:53:38.844 # 
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.

根据网上查询的结果是修改maxheap这个标签的值,但是我改了之后结果是一样的,依然无法运行

报错结果也是一样的错误实在是搞不清楚了。

2个实例的配置文件中第一个使用的是默认配置,第二个只修改了端口号和数据库名

第二个配置:

port 6380

dbfilename dump.6380.rdb

服务器是虚拟机,windows 2008 r2 64bit

依然无法运行啊,有redis的大神帮下吗?

展开
收起
爱吃鱼的程序员 2020-06-14 21:05:22 598 0
1 条回答
写回答
取消 提交回答
  • https://developer.aliyun.com/profile/5yerqm5bn5yqg?spm=a2c6h.12873639.0.0.6eae304abcjaIB

    第一个问题:redis嫌弃你内存不够了,就给你不开第二个实例。<spanstyle="font-family:微软雅黑,Verdana,sans-serif,宋体;font-size:14px;line-height:22px;background-color:#FFFFFF;">TheWindowsversionofRedisallocatesalargememorymappedfileforsharing

    <spanstyle="font-family:微软雅黑,Verdana,sans-serif,宋体;font-size:14px;line-height:22px;background-color:#FFFFFF;">theheapwiththeforkedprocessusedinpersistenceoperations.这句话说的很明白了。

    <spanstyle="font-family:微软雅黑,Verdana,sans-serif,宋体;font-size:14px;line-height:22px;background-color:#FFFFFF;">

    <spanstyle="font-size:14px;line-height:22px;background-color:#FFFFFF;">第二个问题:你端口和Redis服务器的端口不一致,能够运行才怪!

    恩,搞定了,2个实例都设置<spanstyle="font-family:微软雅黑,Verdana,sans-serif,宋体;font-size:14px;line-height:22px;background-color:#FFFFFF;">maxheap为1gb就可以运行了我的版本也是2.8.17,我系统64旗舰版,我设置了<spanstyle="line-height:22px;font-family:微软雅黑,Verdana,sans-serif,宋体;font-size:14px;background-color:#FFFFFF;">maxheap1024000000,结果还是跟你那样的错误在conf文件里设置<spanstyle="font-family:微软雅黑,Verdana,sans-serif,宋体;font-size:14px;line-height:22px;background-color:#FFFFFF;">heapdir,这个目录需要是实际存在的目录,之后启动就没问题了。<divclass='ref'>

    引用来自“薛健”的评论

    在conf文件里设置<spanstyle="font-family:微软雅黑,Verdana,sans-serif,宋体;font-size:14px;line-height:22px;background-color:#FFFFFF;">heapdir,这个目录需要是实际存在的目录,之后启动就没问题了。我的服务器总共内存才1g,结果我设置redis-server--maxheap1024000000,难怪一直失败,我把0削掉一个就好使了<divclass='ref'>

    引用来自“Rayn-瑞恩”的评论

    第一个问题:redis嫌弃你内存不够了,就给你不开第二个实例。<spanstyle="font-family:微软雅黑,Verdana,sans-serif,宋体;font-size:14px;line-height:22px;background-color:#FFFFFF;">TheWindowsversionofRedisallocatesalargememorymappedfileforsharing

    <spanstyle="font-family:微软雅黑,Verdana,sans-serif,宋体;font-size:14px;line-height:22px;background-color:#FFFFFF;">theheapwiththeforkedprocessusedinpersistenceoperations.这句话说的很明白了。

    <spanstyle="font-family:微软雅黑,Verdana,sans-serif,宋体;font-size:14px;line-height:22px;background-color:#FFFFFF;">

    <spanstyle="font-size:14px;line-height:22px;background-color:#FFFFFF;">第二个问题:你端口和Redis服务器的端口不一致,能够运行才怪!

    <divclass='ref'><divclass='ref'>

    引用来自“Rayn-瑞恩”的评论

    第一个问题:redis嫌弃你内存不够了,就给你不开第二个实例。<spanstyle="font-family:微软雅黑,Verdana,sans-serif,宋体;font-size:14px;line-height:22px;background-color:#FFFFFF;">TheWindowsversionofRedisallocatesalargememorymappedfileforsharing

    <spanstyle="font-family:微软雅黑,Verdana,sans-serif,宋体;font-size:14px;line-height:22px;background-color:#FFFFFF;">theheapwiththeforkedprocessusedinpersistenceoperations.这句话说的很明白了。

    <spanstyle="font-family:微软雅黑,Verdana,sans-serif,宋体;font-size:14px;line-height:22px;background-color:#FFFFFF;">

    <spanstyle="font-size:14px;line-height:22px;background-color:#FFFFFF;">第二个问题:你端口和Redis服务器的端口不一致,能够运行才怪!

    2020-06-14 21:05:41
    赞同 展开评论 打赏
问答排行榜
最热
最新

相关电子书

更多
Redis集群演化的心路历程——从2.x到3.0时代 立即下载
TAKING WINDOWS 10 KERNEL 立即下载
ECS运维指南之Windows系统诊断 立即下载