系统 Ubuntu 20.04.6 Redis 5.0.7
现象:
Redis每隔1分钟或者2分钟会自动重启,日志(/var/log/redis/redis-server.log)如下
signal-handler (1710819652) Received SIGTERM scheduling shutdown...
User requested shutdown...
Saving the final RDB snapshot before exiting.
DB saved on disk
Removing the pid file.
Redis is now ready to exit, bye bye...
oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
解决
redis使用apt的方式安装
修改文件/etc/systemd/system/redis.service
将Type=forking修改为Type=simple
然后重新加载服务 systemctl daemon-reload