我正在使用jhipster(4.14.3版)生成一个Web应用程序。问题在于在生产模式下,该应用程序无法连接到在端口9200上运行良好的弹性搜索服务。任何帮助将不胜感激。
application-prod.yml:
data:
elasticsearch:
cluster-name: elasticsearch
cluster-nodes: localhost:9300
elasticsearch.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)
答案 0 :(得分:1)
通常是版本问题。在jhipster项目文件夹中编辑 src / main / docker / elasticsearch.yml ,然后安装相同版本的ElasticSearch服务器。