报错原因

localhost/127.0.0.1:9200es开放的端口,所以和es有关系
在这里插入图片描述

解决方案

spring默认会去监听本地127.0.0.1:9200,修改就好了。

spring:
  elasticsearch:
    rest:
      uris: http://ip地址:9200

还有中说法是es的健康监测机制时间太短,所以加长它的时间

# actuator
management:
  endpoints:
    web:
      exposure:
        include: ['*']
  health:
    elasticsearch:
      response-timeout: 3s

关闭健康监测,不建议

management:
      health:
        elasticsearch:
          enabled: false
Logo

华为开发者空间,是为全球开发者打造的专属开发空间,汇聚了华为优质开发资源及工具,致力于让每一位开发者拥有一台云主机,基于华为根生态开发、创新。

更多推荐