在 presto ( spark ) 上尝试 运行 Elasticsearch 查询时连接被拒绝

connection refused when trying to run Elasticsearch query on presto ( spark )

我正在使用 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" }

如果有人遇到同样的问题,请帮忙。

提前致谢

已解决:我的申请中提到的端口号有问题。通过更改端口(其他一些端口),我能够连接到 Elasticsearch。