nacos后台报数据库连接错误
现象
HikariPool-1 - Failed to validate connection com.mysql.cj.jdbc.ConnectionImpl@17515ba4 (Communications link failure
The last packet successfully received from the server was 1,763,413 milliseconds ago. The last packet sent successfully to the server was 1,763,414 milliseconds ago.). Possibly consider using a shorter maxLifetime value.
原因
因为nacos用的hikari缺省的maxlifetime为30分钟,mysql数据库的wait_time缺省为600秒,所以mysql数据库先于hikari的连接池管理断开了连接,导致连接失效。
解决办法
修改mysql数据库的wait_time,大于30分钟即可。