尝试在 presto ( spark ) 上运行 Elasticsearch 查询时连接被拒绝
Posted
技术标签:
【中文标题】尝试在 presto ( spark ) 上运行 Elasticsearch 查询时连接被拒绝【英文标题】:connection refused when trying to run Elasticsearch query on presto ( spark ) 【发布时间】:2022-01-13 06:46:42 【问题描述】:我正在使用 spark 上的 presto。我有 Elasticsearch 作为数据源。我无法使用 presto 运行查询。
Elasticsearch.properties -
elasticsearch.ignore-publish-address=true
elasticsearch.default-schema-name=default
elasticsearch.host=localhost
connector.name=elasticsearch
elasticsearch.port=2900
docker-compose.yaml
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:7.6.1
container_name: elasticsearch
environment:
- xpack.security.enabled=false
- discovery.type=single-node
- network.host=0.0.0.0
ports:
- '9200:9200'
networks:
- pqp-net
networks:
pqp-net:
driver: bridge
我遇到了错误 -
*c.f.p.e.client.ElasticsearchClient - Error refreshing nodes
com.facebook.presto.spi.PrestoException: Connection refused*
好吧,我可以获取 Elasticsearch 的详细信息:
http://localhost:9200
"name" : "ab751e0dd0ad", "cluster_name" : "docker-cluster", "cluster_uuid" : "3T66bOexSGOo6Pwtt2Ul4Q", "version" :
"number" : "7.6.1",
"build_flavor" : "default",
"build_type" : "docker",
"build_hash" : "aa751e09be0a5072e8570670309b1f12348f023b",
"build_date" : "2020-02-29T00:15:25.529771Z",
"build_snapshot" : false,
"lucene_version" : "8.4.0",
"minimum_wire_compatibility_version" : "6.8.0",
"minimum_index_compatibility_version" : "6.0.0-beta1" , "tagline" : "You Know, for Search"
如果有人遇到同样的问题,请帮忙。
提前致谢
【问题讨论】:
【参考方案1】:已解决:我的应用程序中提到的端口号存在问题。通过更改端口(其他端口),我能够连接到 Elasticsearch。
【讨论】:
以上是关于尝试在 presto ( spark ) 上运行 Elasticsearch 查询时连接被拒绝的主要内容,如果未能解决你的问题,请参考以下文章
Presto on Spark:通过 Spark 来扩展 Presto