For our 2-nodes cluster, we use the following elasticsearch.yml configs:
cluster.name: es-test.domain.tld
node.name: test-elk1
network.host: ["_local_", "_site_"]
http.host: ["_local_", "_site_"]
http.port: 9200
transport.host: ["_local_", "_site_"]
transport.port: 9300
path.data: /opt/elk-data
path.logs: /var/log/elasticsearch
cluster.initial_master_nodes: ["test-elk1", "test-elk2"]
discovery.seed_hosts: ["192.168.1.20:9300", "192.168.1.21:9300"]
gateway.recover_after_data_nodes: 1
node.master: true
node.data: true
...
opendistro_security.ssl.http.enabled: false
Nodes in the cluster:
curl localhost:9200/_cat/nodes
192.168.1.20 54 34 23 1.09 1.96 2.85 dim - test-elk1
192.168.1.21 67 45 29 1.23 1.43 2.47 dim * test-elk2