报错原因

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

为开发者提供学习成长、分享交流、生态实践、资源工具等服务,帮助开发者快速成长。

更多推荐