Skip to content

Elasticsearch health check failed: Connection refused #134

@kanzihuang

Description

@kanzihuang

问题:

Elasticsearch health check failed:Connection refused

日志:

@timestamp:
    Apr 23, 2023 @ 12:40:41.529
@version:
    1
class:
    org.springframework.boot.actuate.elasticsearch.ElasticsearchRestHealthIndicator
host:
    172.19.0.1
level:
    WARN
message:
    Elasticsearch health check failed
pid:
    1
port:
    50,204
project:
    mall-swarm
service:
    mall-search
stack_trace:
    java.net.ConnectException: Connection refused

解决办法:

  1. 打开 nacos->配置管理->配置列表 页面,进入 mall-search-prod.yaml 编辑配置页面

  2. 将以下配置

spring:
  elasticsearch:
    uris: es:9200

修改为:

spring:
  elasticsearch:
    rest:
      uris: es:9200
  1. 然后重新 docker 服务:docker restart mall-search

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions