dnsh
dnsh

Reputation: 3633

Unable to form Elasticsearch 7 cluster on EC2 machines

I have following configuration setup on two AWS ec2 machines.

    Machine 10.0.66.123
    ----------------------
    cluster.name: uat-es-cluster
    node.name: uat-es-1
    path.data: /var/lib/elasticsearch
    path.logs: /var/log/elasticsearch
    network.host: 10.0.66.123
    discovery.seed_hosts: ["10.0.66.106", "10.0.66.123"]
    cluster.initial_master_nodes: ["10.0.66.106", "10.0.66.123"]
    node.master: true


    Machine 10.0.66.106
    ----------------------
    cluster.name: uat-es-cluster
    node.name: uat-es-2
    path.data: /var/lib/elasticsearch
    path.logs: /var/log/elasticsearch
    network.host: 10.0.66.106
    discovery.seed_hosts: ["10.0.66.123", "10.0.66.106"]
    cluster.initial_master_nodes: ["10.0.66.106", "10.0.66.123"]
    node.master: true

I am getting following log on both nodes.

[2019-12-30T10:17:19,037][WARN ][o.e.c.c.ClusterFormationFailureHelper] [uat-es-2] master not discovered yet, this node has not previously joined a bootstrapped (v7+) cluster, and this node must discover master-eligible nodes [10.0.66.106, 10.0.66.123] to bootstrap a cluster: have discovered [{uat-es-2}{DBRJq4uZSJycu7L6vcmZHw}{9k4Ux2veQFiYZcrnHZmFtg}{10.0.66.106}{10.0.66.106:9300}{dilm}{ml.machine_memory=4074115072, xpack.installed=true, ml.max_open_jobs=20}]; discovery will continue using [10.0.66.123:9300] from hosts providers and [{uat-es-2}{DBRJq4uZSJycu7L6vcmZHw}{9k4Ux2veQFiYZcrnHZmFtg}{10.0.66.106}{10.0.66.106:9300}{dilm}{ml.machine_memory=4074115072, xpack.installed=true, ml.max_open_jobs=20}] from last-known cluster state; node term 0, last-accepted version 0 in term 0

Upvotes: 0

Views: 401

Answers (2)

dnsh
dnsh

Reputation: 3633

I was missing inbound rule for TCP, port 9300 in ec2 instance's security group.

Upvotes: 1

AWS PS
AWS PS

Reputation: 4710

Put in the following into your elasticsearch.yml of your master node.

cluster.initial_master_nodes: - node_name_or_ip

Start the first node and then the rest of the nodes.

Upvotes: 0

Related Questions