ElasticSearch 2.0 upgrade now can't connect to server - elasticsearch

I've had an elastic server cluster running for a few months now. 2 node cluster. Pretty simple, things were working pretty nice.
So, I upgraded from 1.7.2 to 2.0.0 today and now I can't get to my servers.... If I curl on the server using local host, everything works fine, if I curl on the machine using it's machine name, I get connection refused.
Upgrading is the only thing that's changed. Any ideas why elastic isn't seeing anything when I use the machine name?
Thanks,
Nick

FWIW you can set the network.host: 0.0.0.0 in elasticsearch.yml or launch as
follows : bin/elasticsearch --network.host 0.0.0.0
This way you should be able to access the cluster in loopback as well as non_loopback

This is, probably, the change in 2.0 that made the cluster accessible only via localhost.
Update each elasticsearch.yml file and provide a network.host for the node.

Related

How do I connect to an elastic search server from a remote computer?

Every guide or post about this topic says to just set network.host: 0 in the elasticsearch.yml file. However I tried that, along with applying other troubleshooting methods, and nothing seems to work. I'm starting to think maybe the configuration is right, but I am not connecting to it the right way?
This is what my yml file looks like,
discovery.seed_hosts: []
network.publish_host: xx.xxx.xxx.51
network.host: 0.0.0.0
The elastic search server is hosted on an Azure virtual machine. Then when I try to connect to it via curl on my local machine I get a Failed to Connect, Timeout Error.
curl http://xx.xxx.xxx.51:9200
The issue was with the network settings which was blocking all the incoming traffic and once incoming traffic on port 9200, default port of Elasticsearch allowed, the issue got resolved.
Just for the reference, you just need to have network.host: 0.0.0.0 config to make sure Elasticsearch isn't using the loopback address and this by default kicks in the production checks which can be avoided in case you are just running a single node discovery.type:single-node, this helps to troubleshoot such issues.

How to Access ElasticSearch From Server?

I am using elastic search in my ubuntu16.04 server. When i am trying to access elasticsearch from browser by using url ip:port/_cat/indices?v. I am getting site can't be reached. After that i am change the network.host value to network.host: 0.0.0.0. After change the network.host ip the search engine not started. How can i access the elasticsearch in my browser.I changed the port also.
Thank you..
There can be many reasons for ES not being reachable. I would start with the obvious and make sure that:
ES is listening on the port: on the ES instance when you run 'curl
ip:port' you should get an answer. if not the service didn't start
well.
make sure there are no firewall rules/security groups that prevent
access from remote network.
make sure network.publish_host is configure correctly:
https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-network.html#advanced-network-settings
more info here: ElasticSearch instance not reachable from outside the server - Azure Windows 2012

Elasticsearch on Azure virtual machine

I have installed elasticsearch on Azure virtual machine.
I have installed the elasticsearch service which which automatically starts on system start up.
Everything works fine on VM. I can access the 9200 port of elasticsearch instance.
The problem is I can not access it with the help of dns name of the virtual machine i.e. xyz.cloudapp.net:9200
I have created endpoints for 9200 and 9300 port.
I want the Elasticsearch on just one VM for now.
Am I missing any steps?
The answer to my question is here.
I needed to add the following to my Elasticsearch config file
network.host: [_local_, _site_]
This works like a charm.
This has been added in ElasticSearch since 2.x.x version.
Thanks

elasticsearch on Ec2 cannot hit public IP(timeout)

I have elasticsearch running on EC2,
I can hit form local IP address(ex. curl -XGET localhost:9200)
I cannot hit from public IP address, whether on the same machine, or from our network, it always times out,
IPtables are allowing
port is open(to itself as well as private network)
Elasticsearch http.cors is enabled and allows "*"
aside from Iptables, amazon security config, elasticsearch config could there be anything I am overlooking? (we can access 443 and get kibana up, it just times out on the elasticsearch ajax call or if I try to access 9200 directly)
been working on this for over a day so I humbly come to you all!
thank you
I had exactly the same issue.
I managed to solve it as follows:
Do what TJ said in his comment, + restart the instance. I wasn't sure if this was/is necessary, but I did it for good measure.
I made sure that the following is set in the elasticsearch.yml file:
a. http.enabled: true
b. http.cors.enabled: true
c. http.cors.allow-origin: "*"
Restarted elasticsearch (service elasticsearch restart)
Then when I tried to access elasticsearch from the public IP it worked - http://[PUBLIC IP OF INSTANCE]:9200
Hope this helps.
I just spent lots of time trying to get this working and just succeeded.
Setup: Elasticsearch 6.2.4, running on a Windows Server 2012, EC2 instance.
I also installed the discovery-ec2 plugin, not sure now if it is required, my assumption is, yes it is required although some of the settings it allows were not necessary to get it working.
Config (.yml). I tried tons of different .yml config settings which in the end did not help, in the end I think the main setting is:
network.host: 0.0.0.0
I tried setting the network.host to ec2:privateIpv4 and ec2:publicIpv4 (plugin settings) but they didn't help.
I had added the required Custom TCP Rules (allowing 9200 and 9300...not sure if 9300 is needed).
Either it failed to start (usually with a binding to 9300 error) or started but was not publicly accessible.
The Fix. What got it working in the end is you must also open the port in windows firewall. As soon as I added the inbound rule, boom it connected :)
I then stripped out all the extra configs I had been trying, restarted Elasticsearch... and it still worked!

Couchbase & ElasticSearch Replication on Vagrant Box

I have successfully setup couchbase and elasticsearch on my machine, and configured the XDCR (cross datacenter replication) without a problem. Now, however I am trying to achieve the same setup on a vagrant box. I have elasticsearch and couchbase running without a problem, and port forwarding setup so I can access the couchbase admin console from my browser.
When I try and setup the replication though I get the following error
Error {econnrefused,[{lhttpc_client,send_request,1}, {lhttpc_client,execute,9},
lhttpc_client,request,9}]} happened during REST call get to http://127.0.0.1:9091/pools.
I am setting up the replication with IP/hostname 127.0.0.1:9091, which is what worked when I was doing it locally, i.e. without vagrant. Could this be the problem? Since localhost isn't referring to the vagrant machine?
At a guess you are trying to use the wrong port for replication - Couchbase uses port 8091 not 9091.
Ok, despite using versions of couchbase and elasticsearch that were supposed to be compatible, I decided to try the same approach with different versions, namely
couchbase-server-enterprise_2.5.1_x86_64.deb
elasticsearch-1.0.1.deb
elasticsearch-transport-couchbase-1.3.0
Instead of port forwarding in my Vagrant file I also made sure I was using a private network
config.vm.network "private_network", ip: "192.168.33.10"
and then when I attempted to setup replication using 192.168.33.10:9091 as the hostname it worked.

Resources