Metricbeat not able to connect with x-pack enabled elastic

Hi

While connecting metricbeat with x-pack enabled elastic cluster , i am getting below error.

2019-07-23T12:45:21.103+0530	INFO	instance/beat.go:292	Setup Beat: metricbeat; Version: 7.2.0
2019-07-23T12:45:21.103+0530	INFO	[index-management]	idxmgmt/std.go:178	Set output.elasticsearch.index to 'metricbeat-7.2.0' as ILM is enabled.
2019-07-23T12:45:21.104+0530	ERROR	tlscommon/tls.go:151	Failed reading CA certificate: <nil>
2019-07-23T12:45:21.105+0530	INFO	instance/beat.go:385	metricbeat stopped.
2019-07-23T12:45:21.105+0530	ERROR	instance/beat.go:877	Exiting: error initializing publisher: 1 error: file is not a certificate adding /etc/metricbeat/ca.crt
Exiting: error initializing publisher: 1 error: file is not a certificate adding /etc/metricbeat/ca.crt

OUTPUT CONFIGURATION

output.elasticsearch:
  # Array of hosts to connect to.
  hosts: ["10.0.0.1:9200"]

  # Optional protocol and basic auth credentials.
  protocol: "https"
  ssl.certificate_authorities: ["/etc/metricbeat/ca.crt"]
  ssl.certificate: "/etc/metricbeat/my.cer"
  ssl.key: "/etc/metricbeat/my.key"
  username: "username"
  password: "password"

Got it.Actually i had enabled tls encryption on elasticsearch ,so after disabling the protocol and converting the ca file in pem format same worked fine.

Update Config

output.elasticsearch:
  # Array of hosts to connect to.
  hosts: ["10.0.0.1:9200"]

  # Optional protocol and basic auth credentials.
  #protocol: "https"
  ssl.certificate_authorities: ["/etc/metricbeat/ca.crt"]
  ssl.certificate: "/etc/metricbeat/my.cer"
  ssl.key: "/etc/metricbeat/my.key"
  username: "username"
  password: "password"

You could try your certificate here. Just replace the cert text and click Run. [https://play.golang.org/p/4UvK6TBeud ](https://play.golang.org/p/4UvK6TBeud)

Command for conversion

openssl pkcs7 -print_certs -in certificate.p7b -out certificate.pem

can anyone please let me know how to enable https on elasticsearch if it's free

can anyone please let me know how to enable https on elasticsearch if it's free.

Hi @abhishek13 :slight_smile:

I guess that you have already checked the docs but maybe this blog post can also help you:

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