Elasticsearch connection refused

Solution 1:

In my case, status=78, it was solved by keeping node.name and cluster.initial_master_nodes with a proper name.

 elasticsearch.service - Elasticsearch
   Loaded: loaded (/usr/lib/systemd/system/elasticsearch.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Wed 2019-08-07 19:55:30 EEST; 3s ago
     Docs: http://www.elastic.co
  Process: 2331 ExecStart=/usr/share/elasticsearch/bin/elasticsearch -p ${PID_DIR}/elasticsearch.pid --quiet (code=exited, status=78)
 Main PID: 2331 (code=exited, status=78)

I read that due to the changes in cluster coordination introduced in Elasticsearch 7.x (https://www.elastic.co/blog/a-new-era-for-cluster-coordination-in-elasticsearch), as the log shows we are forced to configure at least one of those mentioned parameters in production.

In this case it can be easily solved by adding this to your elasticsearch.yml:

node.name: node-1 (or preferred name)

cluster.initial_master_nodes: node-1 (or preferred name)

This is also mentioned in the breaking changes 7.0 documentation of Elasticsearch (https://www.elastic.co/guide/en/elasticsearch/reference/7.0/breaking-changes-7.0.html#_discovery_configuration_is_required_in_production).

Source: https://groups.google.com/forum/#!topic/wazuh/MTNx6RcqRcQ