Kubernetes中Pod无法连接Dragonfly(替代Redis)的服务解析故障排查求助
Kubernetes中Pod无法连接Dragonfly(替代Redis)的服务解析故障排查求助
大家好,我碰到了一个棘手的问题:我的Kubernetes Pod原本是用来连接Redis的,现在我们换成了Dragonfly作为Redis的替代方案,但Pod始终无法成功连接。以下是相关的程序日志:
[2024-04-01 14:34:28.421 DEBUG common_server/src/db/redis_manager.rs:112] creating redis pool with CLIENT NAME: rust-rpauth-5b56497fcf-nz8gt|strict|2 [2024-04-01 14:34:34.444 ERROR common_server/src/db/redis_manager.rs:468] connection error in rust-rpauth-5b56497fcf-nz8gt|strict|2 : failed to lookup address information: Name or service not known [2024-04-01 14:34:53.657 ERROR common_server/src/db/redis_manager.rs:468] connection error in rust-rpauth-5b56497fcf-nz8gt|strict|2 : failed to lookup address information: Name or service not known [2024-04-01 14:34:53.659 ERROR common_server/src/db/redis_manager.rs:468] connection error in rust-rpauth-5b56497fcf-nz8gt|strict|2 : failed to lookup address information: Name or service not known thread 'main' panicked at common_server/src/db/redis_manager.rs:120:14: failed to create new redis pool: Error(Some("failed to lookup address information...
从日志里的错误信息failed to lookup address information: Name or service not known来看,我猜测大概率是DNS解析出了问题,但自己排查了半天还没找到具体原因。想请教下各位大佬,有没有什么排查方向或者解决办法?我整理了几个自己想到的排查点,但还没验证完:
- 确认Dragonfly服务在K8s中的名称、所属命名空间是否正确,Pod连接配置里的服务地址有没有拼写错误
- 进入出问题的Pod(
rust-rpauth-5b56497fcf-nz8gt),用nslookup或dig命令测试Dragonfly服务的DNS解析是否能正常返回IP - 检查Pod和Dragonfly服务是否在同一个命名空间,如果不在,连接地址是不是应该用
服务名.命名空间.svc.cluster.local这种完整的FQDN格式 - 确认Dragonfly服务的端口配置和Pod里Redis客户端的端口是否匹配(Dragonfly默认是6379,不过还是想确认下有没有被修改)
- 检查集群里的CoreDNS组件运行状态是否正常,有没有DNS相关的异常日志
麻烦各位帮忙看看,谢谢啦!
备注:内容来源于stack exchange,提问作者Moonlight
相关产品推荐
相关产品推荐

