空服務啟動時(或者壓根沒引入es相關jar包)報Timeout connecting to [localhost/127.0.0.1:9200]錯誤時,查看pom.xml中是否引用了
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
該組件是sprongboot核心組件之一,里面默認集成了es,會進行es健康檢查
1.取消對es健康檢查在management:標簽中添加
management:
health:
elasticsearch:
enabled: false
2.配置自己可以正常連接的es地址,去替換默認127.0.0.1:9200地址
spring.elasticsearch.rest.uris=["xxxx:9200"]
