首页 > 解决方案 > jhipster:弹性搜索节点不可用

问题描述

我正在使用 jhipster(4.14.3 版)生成一个网络应用程序。问题是在生产模式下,应用程序无法连接到在端口 9200 上运行良好的弹性搜索服务。任何帮助将不胜感激。

应用程序-prod.yml:

data:
    elasticsearch:
        cluster-name: elasticsearch
        cluster-nodes: localhost:9300

弹性搜索.yml:

cluster.name: elasticsearch
path.data: C:\Program Files\elasticsearch-6.2.4\data
path.logs: C:\Program Files\elasticsearch-6.2.4\logs
network.host: 0.0.0.0
http.port: 9200
transport.tcp.port: 9300

异常详情:

org.elasticsearch.client.transport.NoNodeAvailableException: None of the configured nodes are avail
able: [{#transport#-1}{localhost}{127.0.0.1:9300}]
        at org.elasticsearch.client.transport.TransportClientNodesService.ensureNodesAreAvailable(T
ransportClientNodesService.java:326)
        at org.elasticsearch.client.transport.TransportClientNodesService.execute(TransportClientNo
desService.java:223)
        at org.elasticsearch.client.transport.support.TransportProxyClient.execute(TransportProxyCl
ient.java:55)
        at org.elasticsearch.client.transport.TransportClient.doExecute(TransportClient.java:295)
        at org.elasticsearch.client.support.AbstractClient.execute(AbstractClient.java:359)
        at org.elasticsearch.action.ActionRequestBuilder.execute(ActionRequestBuilder.java:86)
        at org.elasticsearch.action.ActionRequestBuilder.execute(ActionRequestBuilder.java:56)

标签: elasticsearchjhipster

解决方案


一般是版本问题。编辑jhipster 项目文件夹中的src/main/docker/ elasticsearch.yml 并安装相同版本的 ElasticSearch 服务器。


推荐阅读