linux部署redis连接超时 Redis command timed out

本文记录了一次在Linux环境中部署Java项目时遇到的Redis连接超时问题。当调用Java接口访问Redis时,出现QueryTimeoutException。问题根源在于redis.conf配置文件中,bind选项限制了访问IP和protected-mode设置为yes,禁止了公网访问。解决方案是注释掉bind 127.0.0.1行,将protected-mode改为no,然后重启redis服务。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

记一次项目部署redis错误,仅供参考

背景:linux上部署Java项目,使用redis

问题:访问Java接口,redis报错

"exception": "org.springframework.dao.QueryTimeoutException",
"trace": "org.springframework.dao.QueryTimeoutException: Redis command timed out; nested exception is io.lettuce.core.RedisCommandTimeoutException: Command timed out after 10 second(s)  网址\n\tat org.springframework.data.redis.connection.lettuce.LettuceExceptionConverter.convert(LettuceExceptionConverter.java:70)\n\tat org.springframework.data.redis.connection.lettuce.LettuceExceptionConverter.convert(LettuceExceptionConverter.java:41)\n\tat org.springframework.data.redis.PassThroughExceptionTranslationStrategy.translate(PassThroughExceptionTranslationStrategy.java:44)\n\tat org.springframework.data.redis.FallbackExceptionTranslationStrategy.translate(FallbackExceptionTranslationStrateg

评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值