Unable to start Elasticsearch as single node and for developing

Hello,

i try to install elasticsearch as single node and noi i production mode i have sette in my elastisearch.yml file:

   cluster.name: elastic-cluster
   node.name: elastic-cluster-node-1
   path.data: C:\Elastic\data
   path.logs: C:\Elastic\logs
   http.port: 9200
   discovery.seed_hosts: ["127.0.0.1", "[::1]"]
   cluster.initial_master_nodes: ["env-elastic-cluster-node-1"]

log :

       [2021-01-21T10:18:18,786][WARN ][o.e.c.c.ClusterFormationFailureHelper] [env-elastic-cluster- 
       node-1] master not discovered or elected yet, an election requires at least 2 nodes with ids 
      from [UlnGHt3XRsSZxZH0YEwVJw, m0QefzOjS7Kq4H0gbly-3A, iPRCXAlVTxCgQoNedae-7w], 
     have discovered [{env-elastic-cluster-node-1}{m0QefzOjS7Kq4H0gbly-3A} 
   {hiLtD6xTSxmL5AL_GJ09xw}{127.0.0.1}{127.0.0.1:9300}{dilmrt} 
   {ml.machine_memory=8589328384, xpack.installed=true, transform.node=true,   
   ml.max_open_jobs=20}] which is not a quorum; discovery will continue using [] from hosts 
    providers and [{env-elastic-cluster-node-1}{m0QefzOjS7Kq4H0gbly-3A} 
  {hiLtD6xTSxmL5AL_GJ09xw}{127.0.0.1}{127.0.0.1:9300}{dilmrt}{ml.machine_memory=8589328384, xpack.installed=true, transform.node=true, ml.max_open_jobs=20}] from last-known cluster state; node term 5, last-accepted version 947 in term 5
    [2021-01-21T10:25:50,051][WARN ][o.e.c.c.ClusterFormationFailureHelper] [env-elastic-cluster-node-1] master not discovered or elected yet, an election requires at least 2 nodes with ids from [UlnGHt3XRsSZxZH0YEwVJw, m0QefzOjS7Kq4H0gbly-3A, iPRCXAlVTxCgQoNedae-7w], have discovered [{env-elastic-cluster-node-1}{m0QefzOjS7Kq4H0gbly-3A}{hiLtD6xTSxmL5AL_GJ09xw}{127.0.0.1}{127.0.0.1:9300}{dilmrt}{ml.machine_memory=8589328384, xpack.installed=true, transform.node=true, ml.max_open_jobs=20}] which is not a quorum; discovery will continue using [] from hosts providers and [{env-elastic-cluster-node-1}{m0QefzOjS7Kq4H0gbly-3A}{hiLtD6xTSxmL5AL_GJ09xw}{127.0.0.1}{127.0.0.1:9300}{dilmrt}{ml.machine_memory=8589328384, xpack.installed=true, transform.node=true, ml.max_open_jobs=20}] from last-known cluster state; node term 5, last-accepted version 947 in term 5

This node used to belong to a three-node cluster, so you can't start it up on its own any more.

The simplest solution, assuming it doesn't contain any useful data, is to delete the contents of path.data (i.e. C:\Elastic\data) and try again.

1 Like

Your node is looking for a master node named env-elastic-cluster-node-1 which doesn't exist because your node.name is elastic-cluster-node-1. You can see this in your logs too:

[2021-01-21T10:18:18,786][WARN ][o.e.c.c.ClusterFormationFailureHelper] [env-elastic-cluster- node-1] master not discovered

This is incorrect for a number of reasons:

  • ... have discovered [{env-elastic-cluster-node-1}... tells us that such a node does exist and we have discovered it,
  • ... [o.e.c.c.ClusterFormationFailureHelper] [env-elastic-cluster-node-1] ... tells us that the node that's writing these logs is called env-elastic-cluster-node-1.
  • the node names are not relevant in elections anyway, nodes don't look for master nodes with particular names once the cluster has formed.

I suspect the OP has hand-edited things and has not done so consistently, since the logs don't match the elasticsearch.yml file they shared, but it doesn't really help to jump to the wrong conclusions like that.

1 Like

You're right. My bad for not reading the logs thoroughly. You could even see the IDs for the three nodes in the logs.

So in a scenario like this if I delete the data in Elastic\data directory. I still need to change the cluster.initial_master_nodes: ["env-elastic-cluster-node-1"] to cluster.initial_master_nodes: ["elastic-cluster-node-1"] , right?

1 Like

Yes, see the NOTE on this page:

The node names used in the cluster.initial_master_nodes list must exactly match the node.name properties of the nodes.

2 Likes

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.