windows 下 redis服务经常自动关闭

[12024] 24 Jul 15:02:55.162 * Redis 3.2.100 (00000000/0) 64 bit, standalone mode, port 6379, pid 12024 ready to start.
[12024] 24 Jul 15:02:55.162 # Server started, Redis version 3.2.100
[12024] 24 Jul 15:02:55.162 * DB loaded from disk: 0.001 seconds
[12024] 24 Jul 15:02:55.162 * The server is now ready to accept connections on port 6379
[12024] 24 Jul 16:04:07.097 * 1 changes in 900 seconds. Saving...
[12024] 24 Jul 16:04:07.117 * Background saving started by pid 6632
[12024] 24 Jul 16:04:07.537 # fork operation complete
[12024] 24 Jul 16:04:37.548 # EndForkOperation: 0x00000005 - EndForkOperation: Killing forked process failed.: permission denied

[4892] 24 Jul 16:05:38.638 * Redis 3.2.100 (00000000/0) 64 bit, standalone mode, port 6379, pid 4892 ready to start.
[4892] 24 Jul 16:05:38.638 # Server started, Redis version 3.2.100
[4892] 24 Jul 16:05:38.638 * DB loaded from disk: 0.001 seconds
[4892] 24 Jul 16:05:38.638 * The server is now ready to accept connections on port 6379
[4892] 24 Jul 16:47:04.511 * 1 changes in 900 seconds. Saving...
[4892] 24 Jul 16:47:04.541 * Background saving started by pid 10076
[4892] 24 Jul 16:47:04.961 # fork operation complete
[4892] 24 Jul 16:47:34.961 # EndForkOperation: 0x00000005 - EndForkOperation: Killing forked process failed.: permission denied


EndForkOperation: 0x00000005 - EndForkOperation:的意思是, 因为序列化的子程序停止,导致redis主程序停止。

安装redis服务使用的是msi安装包, 安装后会自动配置redis服务, 并且配置了服务停止后自动重启服务.
问题就在这里, 在redis序列化的时候,被windows认为是假死状态, 自动停掉的redis服务, 并一分钟后重启

解决办法:

  1. 不使用windows服务的功能, 使用zip压缩包, 既不注册redis服务, 使用黑窗口的形式运行redis
  2. 关闭redis服务模式, 自动改为手动
  3. 禁止自动重新启动
posted @ 2022-12-02 22:25  zhihua  阅读(2162)  评论(0)    收藏  举报