elasticsearchsearchelasticsearch-pluginelasticsearch-5kibana-5

failed to send join request to master elastic search 5.4 cluster


I have configured elastic search with 3 nodes My cluster is not able to find the master node

Logs of elastic search

[2018-02-24T02:39:39,106][INFO ][o.e.d.z.ZenDiscovery     ] [node3] failed to send join request to master [{node1}{MO28S_KZQaih1pd-ERrvIA}{SBwZDgFcTz2xTLOyh2fZAA}{192.168.2.xxx}{192.168.2.xxx:9300}], reason [RemoteTransportException[[node1][192.168.2.xxx:9300][internal:discovery/zen/join]]; nested: NotMasterException[Node [{node1}{MO28S_KZQaih1pd-ERrvIA}{SBwZDgFcTz2xTLOyh2fZAA}{192.168.2.xxx}{192.168.2.xxx:9300}] not master for join request]; ], tried [3] times
[2018-02-24T02:39:42,332][INFO ][o.e.d.z.ZenDiscovery     ] [node3] failed to send join request to master [{node1}{MO28S_KZQaih1pd-ERrvIA}{SBwZDgFcTz2xTLOyh2fZAA}{192.168.2.xxx}{192.168.2.xxx:9300}], reason [RemoteTransportException[[node1][192.168.2.xxx:9300][internal:discovery/zen/join]]; nested: NotMasterException[Node [{node1}{MO28S_KZQaih1pd-ERrvIA}{SBwZDgFcTz2xTLOyh2fZAA}{192.168.2.xxx}{192.168.2.xxx:9300}] not master for join request]; ], tried [3] times

My elasticsearch.yml file

cluster.name: cluster-testing 
node.name: node3
path.data: /var/lib/elasticsearch
path.logs: /var/log/elasticsearch
network.host: 192.168.2.xxx
http.port: 9200
discovery.zen.ping.unicast.hosts: ["192.168.2.xxx", "192.168.2.xxx", 
                                    "192.168.2.xxx"]
discovery.zen.minimum_master_nodes: 2 
gateway.recover_after_nodes: 2 
gateway.expected_nodes: 3

I am not able to find where is the issue


Solution

  • To turn a node into a master node you need to add

    node.master: true
    

    into elasticsearch.yml.

    From your configuration

    discovery.zen.minimum_master_nodes: 2 
    

    at least two of your nodes must set node.master to true

    EDIT:

    you can find below working configuration for our project (3*masters and 6*slaves):

    MASTER:

    cluster.name: VAL_elasticsearch
    node.name: MASTER-${HOSTNAME}
    node.data: false
    node.master: true
    path.data: /data
    path.logs: /local/opt/logs
    path.repo: ["/home/data_ElasticSearchBackup"]
    bootstrap.memory_lock: true
    bootstrap.seccomp: false
    network.host: 0.0.0.0
    http.port: 9200
    transport.tcp.port: 9300
    discovery.zen.ping.unicast.hosts: ["ip_master1","ip_master2","ip_masterx"]
    discovery.zen.minimum_master_nodes: 2
    

    SLAVE:

    cluster.name: VAL_elasticsearch
    node.name: DATA-${HOSTNAME}
    node.data: true
    node.master: false
    path.data: /data
    path.logs: /local/opt/logs
    path.repo: ["/home/data_ElasticSearchBackup"]
    bootstrap.memory_lock: true
    bootstrap.seccomp: false
    network.host: 0.0.0.0
    http.port: 9200
    transport.tcp.port: 9300
    discovery.zen.ping.unicast.hosts: ["ip_master1","ip_master2","ip_masterx"]
    discovery.zen.minimum_master_nodes: 2
    

    Are you sure all ports are open between all elastic instances ?