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)
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.