Hi there,
I am making my first steps in Elasticsearch 8.x coming from 7.x.
On 2 local virtual box nodes I would like to test / to understand the procedure of how I can let join a second Elasticsearch node to an already one-node cluster with Elasticsearch & kibana on it.
Problem: They do not find to each other. I tried several ideas, but it did not work out. Do you have a hint for me?
Some details:
Running on ubuntu 20.04
Installing via vagrant / ansible provisioner
Using: 8.2.0 for both nodes
Already running fine is this node: AllInOne820redis2v4
IP: 192.168.56.113
Here I would like to install / joint Elasticsearch: InOne820redis1v4
IP: 192.168.56.112
I did this on the already fine running node :
/usr/share/Elasticsearch/bin/Elasticsearch-create-enrollment-token -s node
I attach the Elasticsearch.yml of the running node.
On the-to-be-attched node I still need to do a apt-get install for the Elasticsearch deb package.
My question: What steps do I have to do on both nodes so that allyInOne820redis1v4 joins the already fine running one-node-cluster?
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 Unable to communicate with the node on https://10.0.2.15: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 [10.0.2.15:9200] were attempted.
This is logical since it should look at this IP 192.168.56.113 where the second node is running.
QUESTION: Is there a possibility to tell Elasticsearch-reconfigure-node to use a specific IP / network card?
Sorry, I have already taken into account the links.
The point is: on the machine there are 2 IP adresses and this command:
/usr/share/Elasticsearch/bin/Elasticsearch-reconfigure-node --enrollment-token...
takes into consideration the false IP.
Therefore I get this error:
Could not communicate with the node on any of the addresses from the enrollment token. All of [10.0.2.15:9200] were attempted.
So: How can I tell Elasticsearch-reconfigure-node to use the right IP 192.168.56.112?
Cheers
I did this:
/usr/share/Elasticsearch/bin/Elasticsearch-keystore show xpack.security.http.ssl.keystore.secure_password
keytool -keystore /etc/Elasticsearch/certs/http.p12 -storepass <password_I_got_above> -list -v
What I see is:
SubjectAlternativeName [
DNSName: localhost
IPAddress: 192.168.56.112
DNSName: AllInOne820redis1v4
IPAddress: 0:0:0:0:0:0:0:1
IPAddress: 127.0.0.1
IPAddress: fe80:0:0:0:47:98ff:fef4:3985
IPAddress: fe80:0:0:0:a00:27ff:fec1:a7c2
IPAddress: 10.0.2.15
This means that all IPs are known. So why does it say: All of [10.0.2.15:9200] were attempted? Only 1 IP was attampted. Is this a bug?
Did you generate the enrollment token after you added network.host: 192.168.56.112 to the configuration and restarted the node ? The create-enrollment-token tool will connect to the existing node to get information about the node, it will not read the configuration file, so if you made that change but did not restart the node, these changes will not be taken into consideration.
Also, FYI, it looks like you have manually modified the second node configuration file after installation before you ran elasticsearch-reconfigure-node. If you do so, please add configuration options without changing the format of the file. We support running this tool directly after installation, and while we will be permissive in added config options, but we expect to find certain sections in place in the file we have just generated.
Then on the newly created to-be-added node with the IP 192.168.56.112 I did:
vim /etc/hosts
--> Added 2 lines
192.168.56.112 AllInOne820redis1v4
192.168.56.113 AllInOne820redis2v4
apt-get install /tmp/Elasticsearch.deb
vim /etc/Elasticsearch/Elasticsearch.yml
--> here I added 3 lines:
cluster.name: AllInOne820redis2
node.name: AllInOne820redis1
network.host: 192.168.56.112
(no other changes made)
(Elasticsearch has NOT initially been started)
/usr/share/Elasticsearch/bin/Elasticsearch-reconfigure-node --enrollment-token >THE KEY from node .113<
RESULTS:
Unable to communicate with the node on https://10.0.2.15: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 [10.0.2.15:9200] were attempted.
Any idea left what I can further test?
Thank you!!
The soution is:
"It seems like this is caused by the http.host: 0.0.0.0 setting in master's config file. They recommend commenting this setting out, which should trigger the server to take network.host setting into account."
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.