使用PolarDB-X集中式时,使用ProxySQL代理。springboot项目,使用druid连接池。
安装版本如下:
ProxySQL version 2.4.8-2-g2cc900a, codename Truls
PolarDB-X version 2.4.1(PolarDB-X-engine-8.4.19-20241112.el7.x86_64)
项目直连polardb-x主节点正常,但是连接ProxySQL时,提示超时,报错如下:
The last packet successfully received from the server was 59,999 milliseconds ago. The last packet sent successfully to the server was 60,001 milliseconds ago.
; Communications link failure
The last packet successfully received from the server was 59,999 milliseconds ago. The last packet sent successfully to the server was 60,001 milliseconds ago.; nested exception is com.mysql.cj.jdbc.exceptions.CommunicationsException: Communications link failure
The last packet successfully received from the server was 59,999 milliseconds ago. The last packet sent successfully to the server was 60,001 milliseconds ago.
at org.springframework.jdbc.support.SQLExceptionSubclassTranslator.doTranslate(SQLExceptionSubclassTranslator.java:100)
at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:70)
at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:79)
您可以尝试调整PolarDB-X Proxy的连接超时设置,并参考阿里云官方文档进行配置:https://help.aliyun.com/document_detail/137608.html。如果问题依旧存在,建议咨询一下阿里云的工作人员。如果对您有帮助的话,可以帮忙采纳一下。谢谢。
你遇到的问题可能是由于连接超时导致的。可以尝试增加Druid连接池的连接超时时间,并检查ProxySQL和PolarDB-X的配置是否正确,确保网络延迟和丢包率在合理范围内。如果还是不理解的话,可以直接询问阿里云客服,或者提交工单给阿里云的技术顾问,回答不易,麻烦大佬给个采纳,谢谢。
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。
PolarDB 分布式版 (PolarDB for Xscale,简称“PolarDB-X”) 采用 Shared-nothing 与存储计算分离架构,支持水平扩展、分布式事务、混合负载等能力,100%兼容MySQL。 2021年开源,开源历程及更多信息访问:OpenPolarDB.com/about