Elastic Connector cannot talk to ElasticSearch at 9200

I have an Elastic node running on https://localhost:9200 using Docker (using the tutorial on elastic's website here: Install Elasticsearch with Docker | Elasticsearch Guide [8.15] | Elastic)

I can curl to it using a ca_cert and it works fine

curl --cacert http_ca.crt -u elastic:$ELASTIC_PASSWORD https://localhost:9200
{
  "name" : "02f43e1daca5",
  "cluster_name" : "docker-cluster",
  "cluster_uuid" : "bN138Gk1QUmX16GKSqWZWA",
  "version" : {
    "number" : "8.15.2",
    "build_flavor" : "default",
    "build_type" : "docker",
    "build_hash" : "98adf7bf6bb69b66ab95b761c9e5aadb0bb059a3",
    "build_date" : "2024-09-19T10:06:03.564235954Z",
    "build_snapshot" : false,
    "lucene_version" : "9.11.1",
    "minimum_wire_compatibility_version" : "7.17.0",
    "minimum_index_compatibility_version" : "7.0.0"
  },
  "tagline" : "You Know, for Search"

I also have Kibana running in a container

I want to use an S3 connector to be able to connect to Elastic - I used the agent to create the config.yml as suggested...

connectors:
-
  connector_id: "B_34apIBULpfHZa-V4rr"
  service_type: "s3"
  api_key: "api key generated by the configuration feature"
elasticsearch:
  host: "https://localhost:9200"
  api_key: "api key generated by the configuration feature"

But when I run (as per the recommendation in the configurator):


 docker run \       
-v "/Users/sami/elastic-stuff/connectors/config.yml:/config/config.yml" \
--tty \
--rm \
docker.elastic.co/enterprise-search/elastic-connectors:8.15.0.0 \
/app/bin/elastic-ingest \
-c /config/config.yml

I get this error:


[FMWK][08:55:05][INFO] Running preflight checks

[FMWK][08:55:05][INFO] Waiting for Elasticsearch at http://localhost:9200 (so far: 0 secs)

[FMWK][08:55:05][ERROR] Could not connect to the Elasticsearch server

[FMWK][08:55:05][ERROR] Cannot connect to host localhost:9200 ssl:default [Connect call failed ('127.0.0.1', 9200)]

Elasticsearch IS running on https and not http, so I am using that but changing to http, as the configuration suggests doesn't help either

Someone suggested to add to elasticsearch.yml the line network.host: 0.0.0.0 but if this is working for curl, it should work here too, I think...

May be you need to use a docker network for both docker instances and use then something like https://es01:9200 ?

How did you start Kibana actually?

changing my answer since it's irrelevant - thanks David, that did solve the problem - i used https://es01:9200 in the config.yml file

1 Like

From Beats to Elastic Search

Added connectors and removed fleet

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.