Connection refused with ElasticSearch on Digital Ocean - elasticsearch

I install Elastic Search using this tutorial changing only version by Elastic Search.
Set network.host: 127.0.0.1 to access by terminal. But show this error when try connect:
curl: (7) Failed to connect to localhost port 9200: Connection refused

Check your port 9200 is open or not, then check if you're not using the UFW firewall.
In case of you are using the UFW firewall :
sudo ufw allow 9200

Related

Error Connecting to ElasticSearch on CapRover

Have installed ElasticSearch on CapRover using One-Click install; but got the following error when trying to connect:
urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPConnection object at 0x0000019CF191C370>: Failed to establish a new connection: [WinError 10061] No connection could be made because the target machine actively refused it
CapRover remaps the port of ElasticSearch: 9200 -> 80
so need to either explicitly specify the port 80:
"<your url or ip>:80"
or alternatively you can change CapRover's port mapping to 9200

Can't connect to remote ElasticSearch server using local machine's IP Address

I can't connect to ElasticSearch on my Digital Ocean droplet using my local machine's IP Address.
I got the IP Address by: Terminal > ipconfig getifaddr en0
- With that result, let's say: 100.888.777.99
I logged into my droplet by running: ssh username#111.222.3.444
Updated my UFW Rules by running: sudo ufw allow 9200 from 100.888.777.99
From my local machine I ran: curl -X GET 'http://111.222.3.444:9200'
And received: curl: (7) Failed to connect to 111.222.3.444 port 9200: Operation timed out
What am I doing wrong?
Things I've tried:
Changing the network.host variable in elasticsearch/elasticsearch.yml
network.host: 0.0.0.0 (also this a security risk since ip addresses are allowed )
Restarting the server
sudo /etc/init.d/elasticsearch restart
Adding more varibles to elasticsearch/elasticsearch.yml
transport.host: localhost
transport.tcp.port: 9300
http.port: 9200
I found that when I changed the UFW Rules to allow all connection to port 9200, I was able to connect to ElasticSearch from my local machine, but without that, it would not connect.
sudo ufw allow 9200
After some deep diving I found the issue was that the IP address that was returned by Terminal wasn't the correct one to use. I had to use the Public IP Address which I got from https://www.whatismyip.com/, you can also get this by:
Terminal > curl ifconfig.me
So when I removed the old UFW rule: 9200 ALLOW IN 100.888.777.99
And used the Public IP Address: sudo ufw allow 9200 from Public_IP_Address it connected.
I'm still not sure why my machine's IP Address doesn't work though...

curl: (7) Failed to connect to localhost port 9300: Connexion refusée

I am trying to connect nuxeo to elasticsearch 6 with port 9300, but the connection is refused.
When I run the curl -XGET 'localhost: 9300' command,
I got the error message:
curl: (7) Failed to connect to localhost port 9300: Connection refused.
Could you help me to solve this problem?
try it , elastic uses 9200 port for API gateway
curl http://localhost:9200

What port does elasticsearch listen on when installed via homebrew?

I'm using Mac 10.13.6. I just installed elasticsearch via homebrew and launched it ...
brew services start elasticsearch
Service `elasticsearch` already started, use `brew services restart elasticsearch` to restart.
In my /usr/local/etc/elasticsearch/elasticsearch.yml configuration file, I have
http.port: 9200
However, when I attempt to see if that port is available, I get a connection refused ...
localhost:tmp davea$ telnet localhost 9200
Trying ::1...
telnet: connect to address ::1: Connection refused
Trying 127.0.0.1...
telnet: connect to address 127.0.0.1: Connection refused
telnet: Unable to connect to remote host
What port is elasticsearch getting launched on and how can I change that?
That may be the problem of Mac firewall? Edit elasticsearch.yml file in elasticsearch/config folder. Change the localhost to 127.0.0.1 to take a try?
network.host: 127.0.0.1
#
# Set a custom port for HTTP:
#
http.port: 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

Resources