APM-Server 8.1 via Elastic-Agent 8.1 unable to connect to ElasticSearch 8.1

I installed

  • Elasticsearch 8.1
  • Kibana 8.1
  • Fleet-Server 8.1
    on a debian 11 system with default settings.

Via Fleet-Server i installed/enrolled an elastic-agent with a policy and Elastic APM Integration 8.1.
After start of elastic-agent

  • APM-server is running on port 8200
  • Elastic-server is running on port 9200

But APM-server could not connect to Elasticsearch. Should the api-key not be provided by fleet?
In the file /var/lib/elastic-agent/data/elastic-agent-da4d9c/state.yml, I can find under outputs.default.api_key a value, but this seems, that value is not used.

File /var/lib/elastic-agent/data/elastic-agent-da4d9c/install/apm-server-8.1.0-linux-x86_64/apm_server.yml is not configured properly, but I think this is not necessary, because of fleet-integration? And the other thing is, that I think, this file will be overridden on updates.

If I will test the connectivity from apm-agent, I am getting the following error (TLS has been disabled for testing)

:/var/lib/elastic-agent/data/elastic-agent-da4d9c/install/apm-server-8.1.0-linux-x86_64# ./apm-server test output   
elasticsearch: http://localhost:9200...
  parse url... OK
    parse host... OK
    dns lookup... OK
    dial up... OK
  TLS... WARN secure connection disabled
  talk to server... ERROR 401 Unauthorized: {"error":{"root_cause":[{"type":"security_exception","reason":"missing authentication credentials for REST request [/]","header":{"WWW-Authenticate":["Basic realm=\"security\" charset=\"UTF-8\"","ApiKey"]}}],"type":"security_exception","reason":"missing authentication credentials for REST request [/]","header":{"WWW-Authenticate":["Basic realm=\"security\" charset=\"UTF-8\"","ApiKey"]}},"status":401}

Do you have a hint, where to configure this? Or should I use the apm-server standalone installation?


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