【问题标题】:Elastic Search remote connection from Spring boot application来自 Spring Boot 应用程序的 Elastic Search 远程连接
【发布时间】:2019-12-18 14:14:46
【问题描述】:

我正在使用 sping 启动应用程序,如果我使用本地弹性搜索,我可以连接,但如果我使用远程弹性搜索,我将无法连接。

spring:
  data:
    elasticsearch:
      cluster-name: es_psc
      cluster-nodes: 100.84.57.2:9300

如果我在浏览器中运行(http://100.84.57.2:9200/) 我可以看到详细信息

{
  "name" : "i58Q9JC",
  "cluster_name" : "es_psc",
  "cluster_uuid" : "EKeTJwviQvWeTzbS1h1w4w",
  "version" : {
    "number" : "6.4.3",
    "build_flavor" : "default",
    "build_type" : "tar",
    "build_hash" : "fe40335",
    "build_date" : "2018-10-30T23:17:19.084789Z",
    "build_snapshot" : false,
    "lucene_version" : "7.4.0",
    "minimum_wire_compatibility_version" : "5.6.0",
    "minimum_index_compatibility_version" : "5.0.0"
  },
  "tagline" : "You Know, for Search"
}

但我运行我的 Spring Boot 应用程序,它给出以下错误:

Caused by: org.elasticsearch.client.transport.NoNodeAvailableException: None of the configured nodes are available: [{#transport#-1}{6SiLGoTHTmmiuzBTvweb3A}{100.84.57.2}{100.84.57.2:9300}]

【问题讨论】:

    标签: spring-boot elasticsearch remote-connection


    【解决方案1】:

    您在配置文件中使用了错误的端口。您应该使用端口 9200,用于休息通信。

    9300端口用于Elasticsearch节点之间的内部通信。

    【讨论】:

    • 我尝试使用 9200 端口,但仍然从 spring boot 得到同样的异常。下面是我的spring配置:data:elasticsearch:cluster-name:es_psc cluster-nodes:100.84.57.2:9200
    • 根据您的信息,我无法提供更多帮助。我会检查您的节点是否仍然可用,并检查任何可能阻止请求的应用程序防火墙
    猜你喜欢
    • 2017-10-15
    • 1970-01-01
    • 2019-02-12
    • 1970-01-01
    • 1970-01-01
    • 2020-03-18
    • 1970-01-01
    • 2017-10-26
    • 2021-10-14
    相关资源
    最近更新 更多