Elastic search not accessible remotely - elasticsearch

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

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

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.

not able to connect to 9300 port through telnet elastic search

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.

Elasticsearch configuration and settings for nodes

I have just installed ElasticSearch 5.0.0. When I run localhost:9200/_cat/nodes?v it gives me ip as 10.57.203.16. But I want localhost as a server. Where should I configure it ?
What if you add the below line to your elasticsearch.yml ,restart the ES and then try querying for the available nodes:
network.host: 127.0.0.1
EDIT:
Try adding a node name in your elasticsearch.yml :
node.name: elastic_test1

How to configure two nodes to connect to same cluster in elasticsearch?

I have 2 separate machines. Port 9200 is already taken by a separate elasticsearch running, so I specify 9201 as the http.port in the yml file. i set cluster.name: MyCluster.
When I start ./elasticsearch on machine 1 and machine 2, they are not connected, but each are single node master's.
What do I need to do so that they can connect to each other and be part of the same cluster?
I also set network.host: 0.0.0.0 so I know they can see each other. I am using 2.4.0 of Elastcisearch.
In machine 1:
cluster.name: hello_world
network.host: "hostname_or_ip_1"
network.port: 9201
discovery.zen.ping.unicast.hosts: ["hostname_or_ip_2:9201"]
In machine 2:
cluster.name: hello_world
network.host: "hostname_or_ip_2"
network.port: 9201
discovery.zen.ping.unicast.hosts: ["hostname_or_ip_1:9201"]
Both cluster name should be same
discovery.zen.ping.unicast.hosts should point to correct machine
address with port
Make sure to restart elasticsearch node after editing config file
Look at unicast discovery with host:port. https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-discovery-zen.html
You might also need to be explicit about the transport.tcp.port in your elasticsearch.yml:
transport.tcp.port: 9301

Resources