我有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"
}
但是我运行我的弹簧启动应用程序,它给出了以下错误:
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}]
您在配置文件中使用了错误的端口。 您应该使用端口9200,该端口用于 rest 通信。
端口9300用于 Elasticsearch 节点之间的内部通信。