how to connect elasticsearch API through elassandra - elasticsearch

I am using Elassandra. I want to make setup(windows 10) and hit queries
from elastic search url. I have installed Elassandra and start it is working
fine but am not able to access elastic search url. I also tried to
configure host and http.port in elasticsearch.yml but it did not work.
From bin am running Cassandra -e. here is no error in logs but still not
able to access ES on localhost:9200
show the following error
curl: (7) Failed to connect to localhost port 9200: Connection refused
How can one connect elasticsearch in elassandra?

Related

Elasticsearch not able to connect to port 9200

After setting up elasticsearch and kibana, I installed curl.
I tried running this command on terminal:
curl -X GET https://localhost:9200
And it is giving this error.
curl: (7) Failed to connect to localhost port 9200 after 6 ms: Couldn't connect to server
Does anyone know how to resolve this issue?

How to expose elasticsearch setup using eck externally

Hi i would like to expose my elasticsearch cluster in kubernetes created using ECK (https://www.elastic.co/guide/en/cloud-on-k8s/current/index.html) so it can be accessed externally.
I have a requriement to setup Functionbeat to ship aws lambda cloudwatch logs to elastcsearch.
Please see Step 2: Connect to the Elastic Stack https://www.elastic.co/guide/en/beats/functionbeat/current/functionbeat-installation-configuration.html
Attempt:
I have an elastic load balancer that has haproxy running on it which i use to expose other k8 services externally such as frontends. Ive attempted to modify this to also allow me to expose elasticsearch.
haproxy
frontend elasticsearch
bind *:9200
acl host_data_elasticsearch hdr(host) -i elasticsearch.acme.com
use_backend elasticsearchApp if host_data_elasticsearch
backend elasticsearchApp
server data-es data-es-es-http:9200 check rise 1 ssl verify none
Im attempting to see if i can connect using the following curl command:
curl -u "elastic:$ELASTIC_PASSWORD" -k "https://elasticsearch.acme.com:9200"
However i get the following error:
curl: (35) error:1408F10B:SSL routines:ssl3_get_record:wrong version number
In the browser if i navigate to the url i get
This site can’t provide a secure connection
elasticsearch.acme.com sent an invalid response.
ERR_SSL_PROTOCOL_ERROR
Posting answer as community wiki based on #Joao Morais comment:
you added ssl to the server line which instructs haproxy to perform a ssl offload and you didn't add the ssl stuff in the frontend. it seems you should either remove the ssl+verify from the server, add ssl to the front or query a plain http request.
Additional information:
curl: (35) error:1408F10B:SSL routines:ssl3_get_record:wrong version number indicates that you are trying to reach website that is not secure.
To access it you should replace https: with http: in your curl command so it will look like this:
curl -u "elastic:$ELASTIC_PASSWORD" -k "http://elasticsearch.acme.com:9200"

curl: (7) Failed to connect to localhost port 9200: Connection refused. Even after having configured /etc/elasticsearch/elasticsearch.yml

I am trying to check if elasticsearch is properly working on Ubuntu 14.04. So for that, I am running following commands:
$ sudo service elasticsearch start
$ curl -X GET 'http://localhost:9200'
Error:
curl: (7) Failed to connect to localhost port 9200: Connection refused
I am attaching screenshot of my /etc/elasticsearch/elasticsearch.yml file here and also attaching my-application.log
The problem is pretty evident from the log file
org.elasticsearch.ElasticsearchException: X-Pack is not supported and Machine Learning is not available for [linux-x86]; you can use the other X-Pack features (unsupported) by setting xpack.ml.enabled: false in elasticsearch.yml
Simply add this to your elasticsearch.yml config file and restart the service
xpack.ml.enabled: false

Elasticsearch configuration on google cloud

I have installed elastic search on google cloud. I get this error when I try to connect to it:
Elasticsearch ERROR: 2017-04-17T04:27:45Z
Error: Request error, retrying
HEAD http://localhost:9200/ => connect ECONNREFUSED 127.0.0.1:9200
In /etc/elasticsearch/elasticsearch.ym file, I have unsuccessfully tried :
network.host: 127.0.0.1
and
#network.host: 192.168.0.1 (default)
I appreciate if someone help me find out what I'm missing.
on which interface do you want your ElasticSearch to listen to ?
Quickly you can start ES and locally inspect listening sockets with :
netstat -tlpn
ss -tlpn
By default ES listens to localhost, you can find how to manage this here :
https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-network.html
Kind regards.

How to setup Elasticsearch server on remote Ubuntu server?

I have purchased space of 1Gb Ubuntu server to deploy my Elasticsearch Application.
I followed the guide below to deploy Elasticsearch server.
Link to guide
Now whenever I try to access Elasticsearch server using a curl command, it shows the following error
curl: (7) Failed to connect to 0.0.0.0 port 9200: Connection refused
Here is the curl command I tried
curl -XGET '0.0.0.0:9200/?pretty'
Which step could I have missed or is not shown in the guide?
Thank you
Is your elasticsearch service running?
Check with the following command
systemctl status elasticsearch
If it is not running try to start it with
systemctl start elasticsearch
After a few minutes check if it is still running or crashed using systemctl status elasticsearch. If it has crashed please add more details to your question.

Resources