私は領事とmicroserviceとして自分自身を登録する春ブーツJPAアプリケーションを持っている:Consulが私のデータベースに接続しようとするのはなぜですか?
マイapplication.ymlはこのようになります@SpringBootApplication
@EnableDiscoveryClient
@EnableAutoConfiguration
public class Bootstrapper {
public static void main(String[] args) {
SpringApplication.run(Bootstrapper.class, args);
}
}
:
spring:
datasource:
url: jdbc:mysql://localhost:3306/butler_test
username: root
password: pwd
driver-class-name: com.mysql.jdbc.Driver
jpa:
hibernate:
ddl-auto: create
database-platform: org.hibernate.dialect.MySQL5InnoDBDialect
show-sql: false
spring:
cloud:
consul:
discovery:
healthCheckPath: /health
healthCheckInterval: 10s
しかし、領事接点/health
エンドポイントは、以下のときSQLException
が私のアプリケーションでスローされます:
"ホスト '172.17.0.1'はこのMySQLサーバーに接続できません。
何が起こっているのですか、接続試行さえもなぜですか?