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.