本文介绍了确定 Redis 每两分钟收到一个 SIGTERM 的原因的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 Ubuntu 16.04 上运行 redis-server.在最近升级到 redis 3.2.7 之后,我现在看到类似

I'm running redis-server on Ubuntu 16.04. After a recent upgrade to redis 3.2.7 I now see lines like

signal-handler (1486427812) 收到 SIGTERM 调度关闭...每隔一两分钟在 redis 日志中,然后 redis 重新启动.

signal-handler (1486427812) Received SIGTERM scheduling shutdown...every minute or two in the redis log and then redis restarts.

日志中唯一的其他可疑行是:

The only other suspicious line in the logs is:

# WARNING:无法强制执行 TCP 积压设置 511,因为/proc/sys/net/core/somaxconn 设置为较低的值 128.

关于如何诊断为什么会发生这种情况的任何建议将不胜感激.谢谢!

Any advice on how to diagnose why this is happening would be greatly appreciated. Thanks!

推荐答案

仅供参考:正如 J G Miller 的评论一样,您必须注意Type=simple".和守护是"设置不兼容.当我发现这条评论时,我挣扎了几天.我的 redis 只是简单地给出了 start-limit-hit 错误,因为当服务启动时,它立即收到 SIGTERM 信号并停止.

Just for the record:As in J G Miller's comment, you have to watch that "Type=simple" and "daemonize yes" settings are incompatible. I struggeld a few days while I found this comment. My redis just simply gave the start-limit-hit error because when the service started it immediately got the SIGTERM signal and stopped.

所以要么在服务文件中更改Type=forking"或daemonize no"解决此问题的线路,具体取决于您的需求.

So either change in the service file the "Type=forking" or the "daemonize no" lines to solve this, depending on your needs.

这篇关于确定 Redis 每两分钟收到一个 SIGTERM 的原因的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-01 17:25