Hi Team,
While adding nodes to elasticsearch cluster using enrollment token, I am getting the following errors.
[root@elk2 ~]# yum install --enablerepo=elasticsearch elasticsearch -y
Loaded plugins: extras_suggestions, langpacks, priorities, update-motd
elasticsearch | 1.3 kB 00:00:00
Resolving Dependencies
--> Running transaction check
---> Package elasticsearch.x86_64 0:8.4.1-1 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
==============================================================================================================================================================================================================
Package Arch Version Repository Size
Installing:
elasticsearch x86_64 8.4.1-1 elasticsearch 540 M
Transaction Summary
Install 1 Package
Total download size: 540 M
Installed size: 1.1 G
Downloading packages:
elasticsearch-8.4.1-x86_64.rpm | 540 MB 00:00:27
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Creating elasticsearch group... OK
Creating elasticsearch user... OK
Installing : elasticsearch-8.4.1-1.x86_64 1/1
--------------------------- Security autoconfiguration information ------------------------------
Authentication and authorization are enabled.
TLS for the transport and HTTP layers is enabled and configured.
The generated password for the elastic built-in superuser is : 8=IID8ZEYjBaw+c8SNbr
If this node should join an existing cluster, you can reconfigure this with
'/usr/share/elasticsearch/bin/elasticsearch-reconfigure-node --enrollment-token '
after creating an enrollment token on your existing cluster.
You can complete the following actions at any time:
Reset the password of the elastic built-in superuser with
'/usr/share/elasticsearch/bin/elasticsearch-reset-password -u elastic'.
Generate an enrollment token for Kibana instances with
'/usr/share/elasticsearch/bin/elasticsearch-create-enrollment-token -s kibana'.
Generate an enrollment token for Elasticsearch nodes with
'/usr/share/elasticsearch/bin/elasticsearch-create-enrollment-token -s node'.
NOT starting on installation, please execute the following statements to configure elasticsearch service to start automatically using systemd
sudo systemctl daemon-reload
sudo systemctl enable elasticsearch.service
You can start elasticsearch service by executing
sudo systemctl start elasticsearch.service
Verifying : elasticsearch-8.4.1-1.x86_64 1/1
Installed:
elasticsearch.x86_64 0:8.4.1-1
Complete!
[root@elk2 ~]# vi /etc/elasticsearch/elasticsearch.yml
[root@elk2 ~]# cd /etc/elasticsearch/
[root@elk2 elasticsearch]# vi /etc/elasticsearch/elasticsearch.yml
[root@elk2 elasticsearch]# ./elasticsearch-reconfigure-node --enrollment-token eyJ2ZXIiOiI4LjQuMSIsImFkciI6WyIxNzIuNjEuNC4xMTA6OTIwMCJdLCJmZ3IiOiJiZjBjYzZlODA4ZTk3YTFhYzJiOTU5MGYwNjcxM2FkNjIwZTU3OTMyMWQyNzRjNjJjNjE2OWI2Y2M3OWEyNTEzIiwia2V5IjoiMlBjZU40TUIydl9sWkpqQ2VBU2k6OEp0X3A5c1lRMDZma1Z2djNvbkJ0USJ9
-bash: ./elasticsearch-reconfigure-node: No such file or directory
[root@elk2 elasticsearch]# ls
certs elasticsearch.keystore elasticsearch-plugins.example.yml elasticsearch.yml jvm.options jvm.options.d log4j2.properties role_mapping.yml roles.yml users users_roles
[root@elk2 elasticsearch]# cd /usr/share/elasticsearch/bin/
[root@elk2 bin]# ./elasticsearch-reconfigure-node --enrollment-token eyJ2ZXIiOiI4LjQuMSIsImFkciI6WyIxNzIuNjEuNC4xMTA6OTIwMCJdLCJmZ3IiOiJiZjBjYzZlODA4ZTk3YTFhYzJiOTU5MGYwNjcxM2FkNjIwZTU3OTMyMWQyNzRjNjJjNjE2OWI2Y2M3OWEyNTEzIiwia2V5IjoiMlBjZU40TUIydl9sWkpqQ2VBU2k6OEp0X3A5c1lRMDZma1Z2djNvbkJ0USJ9
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
ERROR: Aborting enrolling to cluster. Could not communicate with the node on any of the addresses from the enrollment token. All of [172.61.4.110:9200] were attempted.
[root@elk2 bin]# ./elasticsearch-reconfigure-node --enrollment-token eyJ2ZXIiOiI4LjQuMSIsImFkciI6WyIxNzIuNjEuNC4xMTA6OTIwMCJdLCJmZ3IiOiJiZjBjYzZlODA4ZTk3YTFhYzJiOTU5MGYwNjcxM2FkNjIwZTU3OTMyMWQyNzRjNjJjNjE2OWI2Y2M3OWEyNTEzIiwia2V5IjoiMlBjZU40TUIydl9sWkpqQ2VBU2k6OEp0X3A5c1lRMDZma1Z2djNvbkJ0USJ9
Generates all the necessary security configuration for a node in a secured cluster
Option Description
-E Configure a setting
--enrollment-token The enrollment token to use
-h, --help Show help
-s, --silent Show minimal output
-v, --verbose Show verbose output
ERROR: Aborting enrolling to cluster. This node doesn't appear to be auto-configured for security. Expected configuration is missing from elasticsearch.yml.
[root@elk2 bin]# ./elasticsearch-reconfigure-node --enrollment-token eyJ2ZXIiOiI4LjQuMSIsImFkciI6WyIxNzIuNjEuNC4xMTA6OTIwMCJdLCJmZ3IiOiJiZjBjYzZlODA4ZTk3YTFhYzJiOTU5MGYwNjcxM2FkNjIwZTU3OTMyMWQyNzRjNjJjNjE2OWI2Y2M3OWEyNTEzIiwia2V5IjoiMlBjZU40TUIydl9sWkpqQ2VBU2k6OEp0X3A5c1lRMDZma1Z2djNvbkJ0USJ9^C
[root@elk2 bin]#
[root@elk2 bin]#
[root@elk2 bin]#
[root@elk2 bin]# vi /var/log/elasticsearch/elasticsearch.log
[root@elk2 bin]# /usr/share/elasticsearch/bin/elasticsearch --enrollment-token eyJ2ZXIiOiI4LjQuMSIsImFkciI6WyIxNzIuNjEuNC4xMTA6OTIwMCJdLCJmZ3IiOiJiZjBjYzZlODA4ZTk3YTFhYzJiOTU5MGYwNjcxM2FkNjIwZTU3OTMyMWQyNzRjNjJjNjE2OWI2Y2M3OWEyNTEzIiwia2V5IjoiMlBjZU40TUIydl9sWkpqQ2VBU2k6OEp0X3A5c1lRMDZma1Z2djNvbkJ0USJ9
ERROR: Aborting enrolling to cluster. Could not communicate with the node on any of the addresses from the enrollment token. All of [172.61.4.110:9200] were attempted.
However, telnet shows port is connecting.
[root@ip-172-61-6-28 bin]# telnet 172.61.4.110 9200
Trying 172.61.4.110...
Connected to 172.61.4.110.
Escape character is '^]'.
Please support.