Curl: (7) Failed to connect to xn--localhost-499d port 9200: Connection refused

dilip@ubuntu:~/Desktop/ELK/e/bin$ curl ‘localhost:9200/_cat/health?v’
curl: (7) Failed to connect to xn--localhost-499d port 9200: Connection refused

1 Like

Are you asking for help here?

Yes curl commands are not working for me ,earlier it was working for me with same configuration

Is ES running, can you see it with a ps or similar?

I tried indexing a big log file in ES and it seems it ran out of memory .While starting ES getting error message .

dilip@ubuntu:~/Desktop/ELK/e/bin$ ./elasticsearch
[2016-01-01 22:37:00,278][INFO ][node ] [Felicia Hardy] version[1.7.3], pid[3479], build[05d4530/2015-10-15T09:14:17Z]
[2016-01-01 22:37:00,279][INFO ][node ] [Felicia Hardy] initializing ...
[2016-01-01 22:37:00,741][INFO ][plugins ] [Felicia Hardy] loaded [], sites []
[2016-01-01 22:37:01,098][INFO ][env ] [Felicia Hardy] using [1] data paths, mounts [[/ (/dev/sda1)]], net usable_space [13.4gb], net total_space [18.5gb], types [ext4]
[2016-01-01 22:37:09,723][INFO ][node ] [Felicia Hardy] initialized
[2016-01-01 22:37:09,724][INFO ][node ] [Felicia Hardy] starting ...
[2016-01-01 22:37:10,054][INFO ][transport ] [Felicia Hardy] bound_address {inet[/0:0:0:0:0:0:0:0:9303]}, publish_address {inet[/192.168.161.136:9303]}
[2016-01-01 22:37:10,148][INFO ][discovery ] [Felicia Hardy] elasticsearch/Mw78i0fzQVKU04bJb_0X5w
[2016-01-01 22:37:16,431][WARN ][transport.netty ] [Felicia Hardy] exception caught on transport layer [[id: 0xefeb618f]], closing connection
java.net.NoRouteToHostException: No route to host
at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:744)
at org.elasticsearch.common.netty.channel.socket.nio.NioClientBoss.connect(NioClientBoss.java:152)
at org.elasticsearch.common.netty.channel.socket.nio.NioClientBoss.processSelectedKeys(NioClientBoss.java:105)
at org.elasticsearch.common.netty.channel.socket.nio.NioClientBoss.process(NioClientBoss.java:79)
at org.elasticsearch.common.netty.channel.socket.nio.AbstractNioSelector.run(AbstractNioSelector.java:337)
at org.elasticsearch.common.netty.channel.socket.nio.NioClientBoss.run(NioClientBoss.java:42)
at org.elasticsearch.common.netty.util.ThreadRenamingRunnable.run(ThreadRenamingRunnable.java:108)
at org.elasticsearch.common.netty.util.internal.DeadLockProofWorker$1.run(DeadLockProofWorker.java:42)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
[2016-01-01 22:37:16,465][WARN ][transport.netty ] [Felicia Hardy] exception caught on transport layer [[id: 0x55dc1597]], closing connection

Looks like you have networking issues on the node.

Do you have multiple ES instances on that host?

No I have only one instance of ES

Well you are curling 9200, but it's running on 9203 by the looks of things.

Are you 100% sure there aren't multiple instances running?

I have restarted again ,Please find elasticsearch new started ,curl commands and process running

dilip@ubuntu:~/Desktop/ELK/e/bin$ curl ‘localhost:9200/_cat/indices?v’
curl: (7) Failed to connect to xn--localhost-499d port 9200: Connection refused
dilip@ubuntu:~/Desktop/ELK/e/bin$ ps -ef|grep elasticsearch
dilip 2581 2474 0 01:39 pts/8 00:00:37 /usr/bin/java -Xms256m -Xmx1g -Djava.awt.headless=true -XX:+UseParNewGC -XX:+UseConcMarkSweepGC -XX:CMSInitiatingOccupancyFraction=75 -XX:+UseCMSInitiatingOccupancyOnly -XX:+HeapDumpOnOutOfMemoryError -XX:+DisableExplicitGC -Dfile.encoding=UTF-8 -Delasticsearch -Des.foreground=yes -Des.path.home=/home/dilip/Desktop/ELK/e -cp :/home/dilip/Desktop/ELK/e/lib/elasticsearch-1.7.3.jar:/home/dilip/Desktop/ELK/e/lib/:/home/dilip/Desktop/ELK/e/lib/sigar/ org.elasticsearch.bootstrap.Elasticsearch
dilip 3834 3426 0 02:12 pts/0 00:00:00 vi elasticsearch.yml
dilip 3838 3426 0 02:16 pts/0 00:00:00 vi elasticsearch
dilip 4258 3426 0 02:57 pts/0 00:00:00 grep --color=auto elasticsearch

dilip@ubuntu:~/Desktop/ELK/e/bin$ ./elasticsearch
[2016-01-02 20:14:24,369][INFO ][node ] [Stature] version[1.7.3], pid[2581], build[05d4530/2015-10-15T09:14:17Z]
[2016-01-02 20:14:24,399][INFO ][node ] [Stature] initializing ...
[2016-01-02 20:14:24,837][INFO ][plugins ] [Stature] loaded [], sites []
[2016-01-02 20:14:25,036][INFO ][env ] [Stature] using [1] data paths, mounts [[/ (/dev/sda1)]], net usable_space [13.5gb], net total_space [18.5gb], types [ext4]
[2016-01-02 20:14:32,264][INFO ][node ] [Stature] initialized
[2016-01-02 20:14:32,265][INFO ][node ] [Stature] starting ...
[2016-01-02 20:14:32,548][INFO ][transport ] [Stature] bound_address {inet[/0:0:0:0:0:0:0:0:9300]}, publish_address {inet[/192.168.161.136:9300]}
[2016-01-02 20:14:32,634][INFO ][discovery ] [Stature] elasticsearch/1zmp4ypjTXan4Rj09piJow
[2016-01-02 20:14:36,471][INFO ][cluster.service ] [Stature] new_master [Stature][1zmp4ypjTXan4Rj09piJow][ubuntu][inet[/192.168.161.136:9300]], reason: zen-disco-join (elected_as_master)
[2016-01-02 20:14:36,565][INFO ][http ] [Stature] bound_address {inet[/0:0:0:0:0:0:0:0:9200]}, publish_address {inet[/192.168.161.136:9200]}
[2016-01-02 20:14:36,566][INFO ][node ] [Stature] started
[2016-01-02 20:14:36,752][INFO ][gateway ] [Stature] recovered [6] indices into cluster_state
[2016-01-02 20:14:39,705][WARN ][index.mapper ] [Stature] [test] Type [system.log] contains a '.', it is recommended not to include it within a type name

Try curl 192.168.161.136:9200.

It didn't worked either

I have reinstalled elasticsearch and getting same error though I tried with publish address .Please find below screen shot of ES started and curl command with output

ES STARTED
dilip@ubuntu:~/Desktop/ELK2/e/bin$ ./elasticsearch --node.name Dilip
[2016-01-05 20:57:12,926][INFO ][node ] [Dilip] version[1.7.3], pid[2584], build[05d4530/2015-10-15T09:14:17Z]
[2016-01-05 20:57:12,927][INFO ][node ] [Dilip] initializing ...
[2016-01-05 20:57:13,232][INFO ][plugins ] [Dilip] loaded [], sites []
[2016-01-05 20:57:13,484][INFO ][env ] [Dilip] using [1] data paths, mounts [[/ (/dev/sda1)]], net usable_space [13.3gb], net total_space [18.5gb], types [ext4]
[2016-01-05 20:57:20,823][INFO ][node ] [Dilip] initialized
[2016-01-05 20:57:20,824][INFO ][node ] [Dilip] starting ...
[2016-01-05 20:57:21,165][INFO ][transport ] [Dilip] bound_address {inet[/0:0:0:0:0:0:0:0:9300]}, publish_address {inet[/192.168.161.138:9300]}
[2016-01-05 20:57:21,271][INFO ][discovery ] [Dilip] elasticsearch/2uXlZQr6QKGSr4PweqeHJA
[2016-01-05 20:57:25,132][INFO ][cluster.service ] [Dilip] new_master [Dilip][2uXlZQr6QKGSr4PweqeHJA][ubuntu][inet[/192.168.161.138:9300]], reason: zen-disco-join (elected_as_master)
[2016-01-05 20:57:25,333][INFO ][http ] [Dilip] bound_address {inet[/0:0:0:0:0:0:0:0:9200]}, publish_address {inet[/192.168.161.138:9200]}
[2016-01-05 20:57:25,336][INFO ][node ] [Dilip] started
[2016-01-05 20:57:25,477][INFO ][gateway ] [Dilip] recovered [0] indices into cluster_state

CURL COMMAND
/Desktop/ELK2/e/bin$ curl ‘localhost:9200/_cat/nodes?v’
curl: (7) Failed to connect to xn--localhost-499d port 9200: Connection refused
dilip@ubuntu:~/Desktop/ELK2/e/bin$ curl ‘192.168.161.138:9200/_cat/nodes?v’
curl: (7) Failed to connect to xn--192-mo0a.168.161.138 port 9200: Connection refused

It looks like a local networking issue, why is curl 192.168.161.138 being changed to xn--192-mo0a.168.161.138?

I am a newbie in ES ,I am not sure why is curl 192.168.161.138 being changed to xn--192-mo0a.168.161.138? Please advise how I can trace this issue.

I don't know either, you should ask one your admin people, this is not an ES problem.

Check your java version should be 1.8.x

Why?