空服务启动时(或者压根没引入es相关jar包)报Timeout connecting to [localhost/127.0.0.1:9200]错误时,查看pom.xml中是否引用了
org.springframework.boot
spring-boot-starter-actuator
该组件是sprongboot核心组件之一,里面默认集成了es,会进行es健康检查
1.取消对es健康检查在management:标签中添加
management:
health:
elasticsearch:
enabled: false
2.配置自己可以正常连接的es地址,去替换默认127.0.0.1:9200地址
spring.elasticsearch.rest.uris=["xxxx:9200"]
Original: https://www.cnblogs.com/dockerwyy/p/15787955.html
Author: 不爱喝可乐的吕布
Title: Timeout connecting to [localhost/127.0.0.1:9200]
原创文章受到原创版权保护。转载请注明出处:https://www.johngo689.com/582970/
转载文章受原作者版权保护。转载请注明原作者出处!