Now, I attempted to browse elasticsearch website. However, I can't seem to find the username and password. I tried username like "elastic" and passowrd like 'changeme' 'elastic' 'admin' etc. But they didn't work.
Thus I decided to reset user password for elastic user.
ELASTIC_PASSWORD=$(sudo /usr/share/elasticsearch/bin/elasticsearch-reset-password -u elastic -b -s)
if [[ $? -eq 0 ]]; then
echo "Elastic user password: $ELASTIC_PASSWORD"
else
echo "Failed to reset elastic user password."
exit 1
fi
I try to use this script but no avail.
ERROR: Failed to determine the health of the cluster. Unexpected http status [503], with exit code 65
Failed to reset elastic user password.
When we install the elasticsearch it generates a random password which is shown on the screen during installation.
If you want to reset the password we can use the reset password script, could you please confirm if the elasticsearch is running? Once it is up & running can you try to again execute the script & see what is the error?
Yes it's running And /var/log/elasticsearch/*.log isn't fishy either
[root@rocky8 ~]# systemctl status elasticsearch
● elasticsearch.service - Elasticsearch
Loaded: loaded (/usr/lib/systemd/system/elasticsearch.service; enabled; vendor preset: disabled)
Active: active (running) since Sun 2024-12-08 23:21:12 EST; 3h 3min ago
Docs: https://www.elastic.co
Main PID: 877 (java)
Tasks: 81 (limit: 14920)
Memory: 1.5G
CGroup: /system.slice/elasticsearch.service
├─ 877 /usr/share/elasticsearch/jdk/bin/java -Xms4m -Xmx64m -XX:+UseSerialGC -Dcli.name=server -Dcli.script=/usr/share/ela>
├─1722 /usr/share/elasticsearch/jdk/bin/java -Des.networkaddress.cache.ttl=60 -Des.networkaddress.cache.negative.ttl=10 -D>
└─1741 /usr/share/elasticsearch/modules/x-pack-ml/platform/linux-x86_64/bin/controller
Dec 08 23:18:29 rocky8.linuxvmimages.local systemd[1]: Starting Elasticsearch...
Dec 08 23:19:08 rocky8.linuxvmimages.local systemd-entrypoint[1722]: CompileCommand: dontinline java/lang/invoke/MethodHandle.setAsTy>
Dec 08 23:19:08 rocky8.linuxvmimages.local systemd-entrypoint[1722]: CompileCommand: dontinline java/lang/invoke/MethodHandle.asTypeU>
Dec 08 23:21:12 rocky8.linuxvmimages.local systemd[1]: Started Elasticsearch.
I am suspecting 2GB ram, and 1 core CPU(virtual machine) isn't enough for elasticsearch. If so, I'm done with Elasticsearch as I don't have a new PC atm.
Ok, thanks for the update.
Please execute the curl command against this elastic node to verify if it is returning the response as expected.
The error is clear : ERROR: Failed to determine the health of the cluster.
This command uses an HTTP connection to connect to the cluster and run the user management requests. The command automatically attempts to establish the connection over HTTPS by using the xpack.security.http.ssl settings in the elasticsearch.yml
You have set to authenticate but not SSL on HTTPS or Transport which are the defaults so in order to reset the password you need to give the non HTTPS URL
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.