The last packet successfully received from the server was 39,900 milliseconds ago问题解决
1,之前用Mysql或者mycat的时候都没有这个问题。后来改为haproxy+keepalived+mycat后出现这个问题
2,网上查了很多说法,我按照网上说的改了
datasource:
url: jdbc:mysql://192.168.0.206:8067/NOVADB?useUnicode=true&characterEncoding=utf8&serverTimezone=CTT&autoReconnect=true&failOverReadOnly=false
username: root
password: 123456
driver-class-name: com.mysql.jdbc.Driver
# 使用druid数据源
type: com.alibaba.druid.pool.DruidDataSource
druid:
validationQuery: select 1
testWhileIdle: true
testOnBorrow: true
testOnReturn: true
发现还是不行,后来发现修改haproxy的配置
vim /usr/local/haproxy/haproxy.cfg
后来发现把haproxy的timeout server 120000 改大比如120 秒 就没有这个问题了
文章来自:https://www.cnblogs.com/xiaohanlin/p/11084363.html