not able to connect to 9300 port through telnet elastic search - elasticsearch

I have a elasticsearch node running on a server. My application which is on different server trying to connect to elasticsearch on 9300 through TransportClient. But I am getting following error "Caused by: org.elasticsearch.client.transport.NoNodeAvailableException: None of the configured nodes are available: [{#transport#-1}{Ir-wPDBRR9umDbtoqGIp0A}{X.X.X.X}{X.X.X.X:9300}]".
And I am not able to connect to the elasticsearch server on 9300 port through telnet as well. Here are my elasticsearch.yml settings
transport.host: localhost
transport.tcp.port: 9300
http.port: 9200
network.host: 0.0.0.0
is there any setting I am missing to access the ES remotely?
Any help will be appriciated.

Related

How to access Elasticsearch from other network ? <my static public ip address>:9200

I have my Elasticsearch running on my windows 10 server. I want to access it with < my static public ip address >:9200
I can access my elasticsearch from the server with:
localhost:9200
127.0.0.1:9200
<my ipv4 address from ipconfig>:9200
I can access my elasticsearch from the other device connected to same network as server:
<my ipv4 address from ipconfig>:9200
But i cannot access it with outside of network with:
<my static public ip address>:9200
I have already created inbound port rule for 9200 in firewall settings.
And my network settings in elasticsearch.yml
http.port: 9200
network.host: 0.0.0.0
transport.tcp.port: 9300
discovery.type: single-node
discovery.seed_hosts: ["0.0.0.0", "[::1]"]
network.bind_host: 0.0.0.0
Please help me ?
Note: I have static public ip address and i found my public ip address from https://whatismyipaddress.com/
I have resolved my issue.
Everything was good, i just allowed incoming connection on port 9200 in AWS ec2 console. Now it's working. Thank you.
Now i can access it with <my static public ip address>:9200

Jhipster microservices cause conflict on port 9300 of Elasticsearch

Elasticsearch works with ports 9200 and 9300, but if I start a JHipster micro-service configured to work with Elasticsearch before starting the Elasticsearch service Elasticsearch fails because something in the JHipster service starts at port 9300.
I checked this situation by running the netstat -a command in Windows CMD.
If Elasticsearch uses port 9300 and the microservice will use Elasticsearch, why is the microservice occupying port 9300?
Need to change anything else for the service to use Elasticsearch in dev mode?
You can run elasticsearch on different ports than the default one. To do so add/update in elasticsearch.yml file the following:
http.port: 9201
transport.port: 9301

How to change Elasticsearch network host

I've install ES on my VM which it has an OS of centos 7. It network.host: bind to the localhost. I can browse via port 9200.
My problem is that I've changed the network host to:0.0.0.0 (So I can get public access from my host PC).
the service started but the port is not listening.
I want to access ES from my host PC.
How can i change the network.host ?
I faced same issue in elasticsearch 7.3.0 version. I resolved by putting following
values in /etc/elasticsearch/elasticsearch.yaml as shown below
network.host: 127.0.0.1
http.host: 0.0.0.0
If you are planning to set network.host other than default(127.0.0.1) then change following details in /etc/elasticsearch/elasticsearch.yml
network.host: 0.0.0.0
discovery.seed_hosts: []
Looking at the Elasticsearch Network Settings documentation, it doesn't appear that 0.0.0.0 is a valid setting for network.host.
Try instead the special value _global_. So the section of your elasticsearch.yaml might look like this:
network:
host: _global_
This should tell Elasticsearch to listen on all network interfaces.
Since the version 7.3 of Elastic Search, it's necessary to put the following line
cluster.initial_master_nodes: node-1
network.host: 0.0.0.0
If your application is running on AWS and Elastic search is running on different host
network.host: YOUR_AWS_PRIVATE_IP
This works for me.

kibana not able to connect to server elasticsearch index - ECONNREFUSED

I have elasticsearch server running having indexes, say server XX.XXX.XXX.XXX:9200.
I have index in the server ES cluster XX.XXX.XXX.XXX:9200 for which I am trying to create dashboards in my localhost:5601 (Kibana)
In my kibana.yml I have this configuration:
server.port: 5601
server.host: "localhost"
# The URL of the Elasticsearch instance to use for all your queries.
elasticsearch.url: "http://XX.XXX.XXX.XXX:9200"
In Elasticsearch.yml I have this config:
network.host: 0.0.0.0 (to accept all the IPs)
http.port: 9200
But I am getting this error when running kibana.yml :
connect ECONNREFUSED http://XX.XXX.XXX.XXX:9200
Unable to connect to ElasticSearch at http://XX.XXX.XXX.XXX:9200
Can anyone tell me where am I doing wrong here to get the kibana up and running with the server index of ES?
In your kibana.yml put this configuration:
server.port: 5601
server.host: "0.0.0.0"

Elastic search not accessible remotely

I am trying to access Elastic Search remotely, but getting connection error.
When I curl localhost:9200 in the remote server, I get the desired output. But remotely server_address:9200 is not accessible.
Any suggestions?
In elasticsearch.yml file modify/add network.host setting as below.
network.host: 0.0.0.0
and then restart your elasticsearch server.
Change (/etc/elasticsearch/elasticsearch.yml)network_host IP to your server private IP address.Then the ES can be access with same network range.
network.host: "192.168.xx.xx"
http.port: 9200
Edit your elasticsearch.yml file.
network.host: server_ip
http.port: 9200
transport.tcp.port: 9300

Resources