You should not run Elasticsearch as root. We have an explicit bootstrap check for this reason as you already found out.
This is the suggested way to start Elasticsearch.
You first try to access it on localhost and then on 10.7.1.61, is this really where Elasticsearch is listening?
This either means that something is blocking access to port 9200 or that Elasticsearch is not running. You should check to see if Elasticsearch started correctly by looking at the logs. You can either check journal entries for errors
sudo journalctl --unit elasticsearch
and/or check your logs at /var/log/Elasticsearch.log for indications of what might have gone wrong.
Also, when you run
sudo netstat -nlp | grep 9200
or
ps aux | grep elasticsearch
what do you get ?
Finally, you can show us your elasticsearch.yml file so that we can see how you have configured Elasticsearch.
root@oc-elk:/usr/share/elasticsearch# curl -X GET "10.7.1.61:9200/"
{"error":{"root_cause":[{"type":"security_exception","reason":"missing authentication token for REST request [/]","header":{"WWW-Authenticate":"Basic realm="security" charset="UTF-8""}}],"type":"security_exception","reason":"missing authentication token for REST request [/]","header":{"WWW-Authenticate":"Basic realm="security" charset="UTF-8""}},"status":401}
elk_user@oc-elk:~$ sudo journalctl --unit elasticsearch
-- Logs begin at Wed 2018-05-02 13:16:07 EDT, end at Thu 2018-05-03 09:32:31 EDT. --
May 02 13:16:09 oc-elk systemd[1]: Started Elasticsearch.
May 03 08:58:04 oc-elk systemd[1]: Stopping Elasticsearch...
May 03 08:58:12 oc-elk systemd[1]: Stopped Elasticsearch.
May 03 08:58:12 oc-elk systemd[1]: Started Elasticsearch.
This would indicate that you have already run the setup-passwords command once successfully and set the password for the elastic user, can this be the case ?
If you have set the password but don't remember what it is, you can do a "password reset" reading through the instructions and information in the seminal post from @TimV
Ok , then you don't need to run setup-passwords again. You have successfully installed X-Pack, you have set the passwords for your internal users, then you're good to go. To make authenticated requests to Elasticsearch you need to pass the -u parameter in curl , i.e.
curl -X GET -u elastic "http://10.7.1.61:9200/"
and enter the password you had set once you are prompted
I have successfully installed x-pack on elasticsearch, kibana, and logstash. I did not complete the TLS installation section. Is the TLS section necessary on a single node deployment?
I have a trial license until June 2. The kibana console shows this trial license to be active. I cannot get the status from the command line:
root@oc-elk:~# GET _xpack/license/trial_status
Can't connect to _xpack:80
Temporary failure in name resolution at /usr/share/perl5/LWP/Protocol/http.pm line 47.
No, not while you're on a trial license or if you choose to continue with a license that doesn't enable X-Pack security.
The example from which you copy pasted that is meant as an instruction to be run via Kibana's dev console and not in your linux shell. In many linux distributions GET ( as in /usr/bin/GET ) is a symbolic link to lwp-request and this is what throws this error.
You either need to copy paste this command in your kibana dev console or click on the "Copy as curl" which will put
curl -X GET "localhost:9200/_xpack/license/trial_status"
As we discussed above, now that you have X-Pack security enabled you need to make authenticated calls with CURL so you need to pass the -u elastic parameter.
To be clear: There is nothing wrong with your installation, and there is no need to report here that the command will succeed. As you have already seen via Kibana the trial license is valid until June 2, you just want to access the same information directly from the Elasticsearch API. The response will be the same.
thank you for the clarification - here is the corrected result - i only want to ensure the licensing is correct - we will most likely purchase a license for this product very soon once i can get the PoC up
root@oc-elk:/usr/share/elasticsearch# curl -X GET -u elastic "10.7.1.61:9200/_xpack/license/trial_status"
Enter host password for user 'elastic':
{"eligible_to_start_trial":false}
You get only this result because _xpack/license/trial_status is the trial status API. If you want to get more details you should query the Get license API at x_pack/license that will return the expiration date and other information.
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.