Error encountered in metric beat installation

Hi,
We are running a 3 Node Elastic Cluster with Basic security features enabled and HTTPS communication with browser and Kibana enabled.

We have followed the [https://www.elastic.co/guide/en/elasticsearch/reference/current/security-basic-setup-https.html.]

After settiing up the cluster we have installed metricbeat for monitoring the cluster.

The metricbeat.yml configuration is as below.

# ---------------------------- Elasticsearch Output ----------------------------
output.elasticsearch:
  # Array of hosts to connect to.
  hosts: ["https://192.168.1.10:9200"]

  # Performance preset - one of "balanced", "throughput", "scale",
  # "latency", or "custom".
  preset: balanced

  # Protocol - either `http` (default) or `https`.
  protocol: "https"

  # Authentication credentials - either API key or username/password.
  #api_key: "id:api_key"
  username: "admin"
  password: "admin"
  ssl:
   enabled: true
   ca_trusted_fingerprint: "65f57t6bdb03ebe84791822367ae236ax7189d838817850618b6547bb7881d96"
  #certificate_authorities: ["/etc/metricbeat/elasticsearch-ca.pem"]

After that the elasticsearch & elasticsearch-xpack module has been enabled and configured to connect with the elastic cluster. The elasticsearch-xpack.yml configuration is below.

- module: elasticsearch
  xpack.enabled: true
  period: 10s
  hosts: ["https://10.25.176.119:9200"]
  username: "elastic"
  password: "elastic"
  ssl.enabled: true
  ssl.certificate_authorities: ["/etc/metricbeat/elastic-stack-ca.pem"]

After that while executing the command- ”metricbeat setup -e” the following error is being generated.

{"log.level":"error","@timestamp":"2024-05-20T10:23:55.099+0530","log.origin":{"function":"github.com/elastic/beats/v7/libbeat/cmd/instance.handleError","file.name":"instance/beat.go","file.line":1340},"message":"Exiting: couldn't connect to any of the configured Elasticsearch hosts. Errors: [error connecting to Elasticsearch at https://192.168..1.10:9200: Get \"https://192.168.1.10:9200\": x509: certificate signed by unknown authority]","service.name":"metricbeat","ecs.version":"1.6.0"}
Exiting: couldn't connect to any of the configured Elasticsearch hosts. Errors: [error connecting to Elasticsearch at https://192.168.1.10:9200: Get "https://192..168.1.10:9200": x509: certificate signed by unknown authority]

How could solve this error?
Thank You.

Hi @viera120,

This is most likely a certificate configuration issue. I see you have property output.elasticsearch.ssl.certificate_authorities commented out.

Do you receive the same error when output.elasticsearch.ssl.certificate_authorities is specified? There is a similar issue solved by this property located here. I would recommend double checking the SSL settings documentation.

Let us know if that resolves the issue.