报错原因
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