0

I'm trying to setup a 2 node cluster. But it seems like the nodes cannot discover each other.

Node 1 yaml file

cluster.name: es-cluster
node.name: es-node-a
path.data: /my/path/data/elasticsearch
path.logs: /my/path/log/elasticsearch
network.host: xx.xxx.xxx.xx
discovery.seed_hosts:
        - yy.yyy.yyy.yy
cluster.initial_master_nodes:
        - es-node-a
        - es-node-b

Node 2 yaml file

cluster.name: es-cluster
node.name: es-node-b
path.data: /my/path/data/elasticsearch
path.logs: /my/path/log/elasticsearch
network.host: yy.yyy.yyy.yy
discovery.seed_hosts:
        - xx.xxx.xxx.xx
cluster.initial_master_nodes:
        - es-node-a
        - es-node-b

Is something wrong with my configuration?

nick
  • 1,611
  • 4
  • 20
  • 35
  • 1
    What do you have in the logs? Update your question with the log messages. Also, put both nodes in the `discovery.seed_hosts` configuration. But with 2 nodes I would recommend to choose one of them to be the master and set the other to be non-master eligible, in a 2 node cluster there is no resilience, you can't afford to lose a node, so it is easier to have just one master eligible. – leandrojmp Sep 12 '21 at 14:53

1 Answers1

0

Set both discovery.seed_hosts to the same host.

I agree with @leandrojmp, in a 2-node cluster setup, you can only choose 1 node to be the fixed master node permanently. Read here.

hoohoo-b
  • 1,141
  • 11
  • 12