Timeout connecting to [localhost/127.0.0.1:9200]


空服務啟動時(或者壓根沒引入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"]


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM