返回文章列表

Redis报错too many open files

lyj

Redis报错too many open files:围绕查看PID、杀死进程、Close the connection after a client is idle for N seconds (0 to disable)等内容展开,整理关键步骤、配置方法、注意事项和常见问题,便于快速查阅与实践。

Redis报错了 too many open files

这时候应该通过redis-cli SHUTDOWN停止不掉redis-server,因为connect refuse

可以直接kill掉进程

# 查看PID
ps -e | grep redis

# 杀死进程
kill -9 PID

杀死进程后,通过lsof查看端口占用情况,还是有很多,这时kill掉占用端口的进程

kill -9 $(lsof -t -i:redis端口)

修改redis.conf配置文件,修改timeout

# Close the connection after a client is idle for N seconds (0 to disable)
timeout = 300

启动redis

redis-server /etc/redis/redis.con