New node cannot join to the existing cluster

I have two servers for elasticsearch. After I installed the elasticsearch on one server, I started the service and ran
/usr/share/elasticsearch/bin/elasticsearch-create-enrollment-token -s node to generate an environment token. Then, I installed the elasticsearch on the other server, I reconfigured the new node by running

/usr/share/elasticsearch/bin/elasticsearch-reconfigure-node --enrollment-token eyJ2Z***rQSJ9
This node will be reconfigured to join an existing cluster, using the enrollment token that you provided.
This operation will overwrite the existing configuration. Specifically:
  - Security auto configuration will be removed from elasticsearch.yml
  - The [certs] config directory will be removed
  - Security auto configuration related secure settings will be removed from the elasticsearch.keystore
Do you want to continue with the reconfiguration process [y/N]y

Then, I started the elasticsearch service on the second server.
However, the log file give me FAILED error:

[newnode] handshake to [10.0.0.12:9300] failed
java.lang.IllegalStateException: handshake with [{10.0.0.12:9300}{Y4Snh**oQ}{10.0.0.12}{10.0.0.12:9300}{7.17.0}] failed: remote cluster name [ElasticSearch] does not match local cluster name [elasticsearch]

I only set up a cluster name for the first node. I did not set up any cluster name for the new node. How can I fix the cluster name issue? Thanks.

BTW, I am running on java openjdk 11.0.19 and Elasticsearch 8.8

When I checked the nodes in the existing cluster by running

curl -X GET 'http://localhost:9200/_nodes?pretty'

I got only one node under this cluster.

{
  "_nodes" : {
    "total" : 1,
    "successful" : 1,
    "failed" : 0
  }

The new node did not join this cluster successfully.

On the first server, I got a warning message in the log.

This node is a fully-formed single-node cluster with cluster UUID [nTodc**WWA], but it is configured as if to discover other nodes and form a multi-node cluster via the [discovery.seed_hosts=[10.0.0.12:9300, 10.0.0.13:9300]] setting. Fully-formed clusters do not attempt to discover other nodes, and nodes with different cluster UUIDs cannot belong to the same cluster. The cluster UUID persists across restarts and can only be changed by deleting the contents of the node's data path(s). Remove the discovery configuration to suppress this message.

I want to make a multi-node cluster. How should I set up the cluster mode on the node?

Please share the elasticsearch.yml of both nodes.

The cluster.name needs to be the same in both.

1 Like

Thank you for replying my question. I checked my cluster name again. I found I made a mistake which has wasted much time.. I used one uppercase letter in the name on the first server. Right now, the cluster has been set up well.

1 Like

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