Hello,
I am attempting to enable SSL encryption between Logstash and Elasticsearch but on restarting my logstash node, I receive error:
[2019-07-03T12:36:42,992][DEBUG][logstash.outputs.elasticsearch] Running health check to see if an Elasticsearch connection is working {:healthcheck_url=>https://logstash_writer:xxxxxx@espdata1:9200/, :path=>"/"} [2019-07-03T12:36:43,003][WARN ][logstash.outputs.elasticsearch] Attempted to resurrect connection to dead ES instance, but got an error. {:url=>"https://logstash_writer:xxxxxx@espdata1:9200/", :error_type=>LogStash::Outputs::ElasticSearch::HttpClient::Pool::BadResponseCodeError, :error=>"Got response code '401' contacting Elasticsearch at URL 'https://espdata1:9200/'"} [2019-07-03T12:36:43,003][DEBUG][logstash.outputs.elasticsearch] Running health check to see if an Elasticsearch connection is working {:healthcheck_url=>https://logstash_writer:xxxxxx@espdata2:9200/, :path=>"/"} [2019-07-03T12:36:43,012][WARN ][logstash.outputs.elasticsearch] Attempted to resurrect connection to dead ES instance, but got an error. {:url=>"https://logstash_writer:xxxxxx@espdata2:9200/", :error_type=>LogStash::Outputs::ElasticSearch::HttpClient::Pool::HostUnreachableError, :error=>"Elasticsearch Unreachable: [https://logstash_writer:xxxxxx@espdata2:9200/][Manticore::SocketException] Connection refused (Connection refused)"}
I have enabled HTTP encryption in my three Elasticsearch nodes as per elasticsearch.yml snippet below. My SSL certificates are generated by an internal CA.
xpack.security.transport.ssl.enabled: true xpack.security.transport.ssl.verification_mode: none xpack.security.transport.ssl.key: config/espdata0.key xpack.security.transport.ssl.certificate: config/espdata0.crt xpack.security.transport.ssl.certificate_authorities: ["/etc/elasticsearch/config/CARoot.crt","/etc/elasticsearch/config/CAIntermediate.crt"] xpack.security.http.ssl.enabled: true xpack.security.http.ssl.key: config/espdata0.key xpack.security.http.ssl.certificate: config/espdata0.local.crt xpack.security.http.ssl.certificate_authorities: ["/etc/elasticsearch/config/CARoot.crt","/etc/elasticsearch/config/CAIntermediate.crt"]
In Logstash, I have configured the below in my .conf file output filter. I set certificate verification to 'false' after reading some other posts related to issues with certificates that were generated from an internal CA... In the cacert field I also tried '/etc/logstash/config/CARoot.crt' but had the same outcome.
output {
elasticsearch {hosts => ["espdata0:9200","espdata1:9200","espdata2"] index => "meterflow-%{+YYYY.MM.dd}" user => "logstash_writer" password => "Elastic$tack" ssl => true ssl_certificate_verification => false cacert => "/etc/logstash/config/CAIntermediate.crt" } }
In logstash.yml I have set monitoring to false:
xpack.monitoring.enabled: false
Can anyone suggest where I may be going wrong here?
Thanks,
Paul