ES8.14 has 5 nodes. But master is down and reinstalled. How to join the new cluster?

ES8.14 has 5 nodes. But master was down and reinstalled. How to join the new cluster?

  1. ES8.14 has 5 nodes. But master[node-04] was down and reinstalled.
  2. The current es cluster is running well with new master[node-05].
  3. I generated the "/usr/share/elasticsearch/bin/elasticsearch-create-enrollment-token -s node" in node-02.
  4. Executed the "/usr/share/elasticsearch/bin/elasticsearch-reconfigure-node --enrollment-token newToken" in node-04.
    Unable to communicate with the node on http s://node-04:9200/_security/enroll/node. Error was Connection refused
    ERROR: Aborting enrolling to cluster. Could not communicate with the node on any of the addresses from the enrollment token. All of [node-04:9200] were attempted., with exit code 69
  5. "elasticsearch-create-enrollment-token -s node" will generate new token based on the old master value [node-04] in elasticsearch.yml, not from the new master[node-05]. Right?
    Like this scenario, how can I let node-04 join the new cluster?

That error message doesn't align with the steps you say you took.

If you generated a token on node-02 then the error message should not be mentioning node-04.

Can you double check that what you've written above is exactly what happened?