Elasticsearch Connection Refused
Hallo, is anyone here using elasticsearch on CentOS?
I tried several configs to configure external access but nothing is working. My tests:
telnet localhost or 127.0.0.1 9200 works local on the machine telnet 192.168.242.4 9200 connection refused local on the machine. So
it is clear that access from other systems can not work. Is there perhaps something special to consider when using CentOS 7?
Thanks for hints.
Ralf
9 thoughts on - Elasticsearch Connection Refused
Hi Ralf,
You should check you firewall configuration … most probably you need to allow port 9200. Also check if elasticsearch service is listening on all interfaces or just localhost (127.0.0.1).
-I.
Am 19.02.2019 um 13:55 schrieb Ionut Hoza:
Hallo, the firewall is disabled. I tried several variations in the config-file.
0.0.0.0
192.168.242.4
Only 127.0.0.1 is working buth only withz local access.
Ralf
Selinux will not allow connections on other than default http ports.
semanage port -m -t http_port_t -p tcp 9200
Andrea
—–Original Message—
It’s not a web server port – elasticsearch is a database.
P.
Sorry, that was a bit abrupt – yes, it sort of looks like a web server. Does selinux interpret it as such?
P.
Can you see if it is listening on 9200 on the non localhost address?
I have the line
network.host: 10.0.0.1
in my config that binds it to that specific IP address and I have lines like
java 48111 elasticsearch 382u IPv6 1550135 0t0 TCP 10.0.0.1:vrace (LISTEN)
java 48111 elasticsearch 530u IPv6 1608995 0t0 TCP 10.0.0.1:wap-wsp (LISTEN)
in the lsof output.
P.
We can either set selinux to permissive (not suggested) or open a port. Writing custom ports in selinux is not my specialty.
Andrea
—–Original Message—
Set your network address as “network.host” in
/etc/elasticsearch/elasticsearch.yml
It’s a bit of both. It is queryable like a database, but it answers requests using HTTP methods.
–keith