xuxueli / xxl-job

A distributed task scheduling framework.(分布式任务调度平台XXL-JOB)
http://www.xuxueli.com/xxl-job/
GNU General Public License v3.0
27.63k stars 10.93k forks source link

docker-compose配置一直出现 java.sql.SQLNonTransientConnectionException: Could not create connection to database server. Attempted reconnect 3 times. Giving up #3370

Open wjs1995 opened 10 months ago

wjs1995 commented 10 months ago

我的docker-compose设置 mysql配置 db: image: mysql:latest hostname: db container_name: db environment:

错误

xxl-job-admin | 20:41:05.910 logback [xxl-job, admin JobScheduleHelper#scheduleThread] ERROR com.zaxxer.hikari.pool.HikariPool - HikariCP - Exception during pool initialization. xxl-job-admin | java.sql.SQLNonTransientConnectionException: Could not create connection to database server. Attempted reconnect 3 times. Giving up. xxl-job-admin | at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:110) xxl-job-admin | at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:97) xxl-job-admin | at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:89) xxl-job-admin | at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:63) xxl-job-admin | at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:73) xxl-job-admin | at com.mysql.cj.jdbc.ConnectionImpl.connectWithRetries(ConnectionImpl.java:894) xxl-job-admin | at com.mysql.cj.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:819) xxl-job-admin | at com.mysql.cj.jdbc.ConnectionImpl.(ConnectionImpl.java:444) xxl-job-admin | at com.mysql.cj.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:237) xxl-job-admin | at com.mysql.cj.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:198) xxl-job-admin | at com.zaxxer.hikari.util.DriverDataSource.getConnection(DriverDataSource.java:138) xxl-job-admin | at com.zaxxer.hikari.pool.PoolBase.newConnection(PoolBase.java:364) xxl-job-admin | at com.zaxxer.hikari.pool.PoolBase.newPoolEntry(PoolBase.java:206)

MeWannaSleep commented 3 months ago

老哥, 你解决了吗

DragonXiu commented 2 months ago

我在部署服务器上出现过,数据库也在服务器上,把IP换成127.0.0.1就好了