Failed to connect to backoff(elasticsearch(http://localhost:9200))

I setup Elasticsearch version 8.6.1 the default way which generates self signed certificates so that the Elasticsearch endpoint uses https (https://localhost:9200).

I installed the elastic-agent as a windows service using the command generated from Kibana UI:

.\elastic-agent.exe install
--fleet-server-es=https://localhost:9200
--fleet-server-service-token=xxx
--fleet-server-policy=fleet-server-policy

When looking into the logs I get the error message in C:\Program Files\Elastic\Agent\elastic-agent-20230208.ndjson

Failed to connect to backoff(elasticsearch(http://localhost:9200))

  1. I am wondering why the agent uses http and not https? (I specified https in the install command above)
  2. Where can I make these changes? (I tried to edit "C:\Program Files\Elastic\Agent\elastic-agent.yml" and restart the "Elastic Agent" service.)

I solved it - please refer to this answer: How do I setup APM all on one machine?

1 Like