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 秒 

20190628

后来发现haproxy中几个 参数都要改成120000 才行(具体哪个生效不知道,后续再研究)

并且task的service还是有报错因为没有配置

plan配置了就没有这个报错了

spring:
profiles: prd
application:
name: novaplanserv
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

后来发现

原文地址:https://www.cnblogs.com/xiaohanlin/p/11084363.html