gpt4 book ai didi

Spring Elasticsearch - 配置的节点均不可用

转载 作者:行者123 更新时间:2023-11-29 02:46:04 25 4
gpt4 key购买 nike

我正在将 spring-boot 与 Elasticsearch 结合使用。该项目是使用 jhipster 创建的。

pom.xml 包含:

<parent>
<artifactId>spring-boot-starter-parent</artifactId>
<groupId>org.springframework.boot</groupId>
<version>1.4.0.RELEASE</version>
<relativePath/>
</parent>

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-elasticsearch</artifactId>
</dependency>

在生产模式下,出现如下错误:

AbstractElasticsearchRepository : failed to load elasticsearch nodes :    
org.elasticsearch.client.transport.NoNodeAvailableException: None of
the configured nodes are available: [{#transport#-1}{127.0.0.1}
{localhost/127.0.0.1:9300}]

我该如何解决这个错误?

最佳答案

在开发配置文件中,JHipster 使用嵌入式 Elasticsearch。

在生产配置文件中,默认情况下它会尝试连接到本地集群,因此要么您没有在本地计算机上安装 Elasticsearch,要么您尚未在 application-prod.yml 中配置正确的 URL 以连接到现有集群。

关于Spring Elasticsearch - 配置的节点均不可用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39173891/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com