Error Elasticsearch failed to connect to the master - there is no route to the host

When I run elasticsearch 0.90.0 with the command: bin/elasticsearch -f , I get this error:

 [2014-09-17 15:00:27,998][INFO ][node ] [Myers, Fred] {0.90.0}[8030]: initializing ... [2014-09-17 15:00:28,005][INFO ][plugins ] [Myers, Fred] loaded [], sites [] [2014-09-17 15:00:30,508][INFO ][node ] [Myers, Fred] {0.90.0}[8030]: initialized [2014-09-17 15:00:30,508][INFO ][node ] [Myers, Fred] {0.90.0}[8030]: starting ... [2014-09-17 15:00:30,762][INFO ][transport ] [Myers, Fred] bound_address {inet[/0:0:0:0:0:0:0:0:9301]}, publish_address {inet[/192.168.0.108:9301]} [2014-09-17 15:00:36,874][WARN ][discovery.zen ] [Myers, Fred] failed to connect to master [[Holly][nlr9o-yfSQ6MsTtYlTlqlw][inet[/192.168.1.6:9300]]], retrying... org.elasticsearch.transport.ConnectTransportException: [Holly][inet[/192.168.1.6:9300]] connect_timeout[30s] at org.elasticsearch.transport.netty.NettyTransport.connectToChannels(NettyTransport.java:671) at org.elasticsearch.transport.netty.NettyTransport.connectToNode(NettyTransport.java:610) at org.elasticsearch.transport.netty.NettyTransport.connectToNode(NettyTransport.java:580) at org.elasticsearch.transport.TransportService.connectToNode(TransportService.java:127) at org.elasticsearch.discovery.zen.ZenDiscovery.innterJoinCluster(ZenDiscovery.java:337) at org.elasticsearch.discovery.zen.ZenDiscovery.access$500(ZenDiscovery.java:76) at org.elasticsearch.discovery.zen.ZenDiscovery$1.run(ZenDiscovery.java:290) 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) Caused by: java.net.NoRouteToHostException: No route to host at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method) at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:739) at org.elasticsearch.common.netty.channel.socket.nio.NioClientBoss.connect(NioClientBoss.java:150) 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:312) 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) ... 3 more [2014-09-17 15:00:36,874][WARN ][transport.netty ] [Myers, Fred] exception caught on transport layer [[id: 0x361eaf47]], 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:739) at org.elasticsearch.common.netty.channel.socket.nio.NioClientBoss.connect(NioClientBoss.java:150) 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:312) 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) [2014-09-17 15:00:42,892][WARN ][transport.netty ] [Myers, Fred] exception caught on transport layer [[id: 0x2656abc9]], 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:739) at org.elasticsearch.common.netty.channel.socket.nio.NioClientBoss.connect(NioClientBoss.java:150) at org.elasticsearch.common.netty.channel.socket.nio.NioClientBoss.processSelectedKeys(NioClientBoss.java:105) ... 

I do not install logstash. When I access localhost:9200 , I get

 { ok: true, status: 503, name: "Haywire", version: { number: "0.90.0", snapshot_build: false }, tagline: "You Know, for Search" } 

Can someone help me solve this problem?

+7
elasticsearch
source share
3 answers

Give a name to your cluster and the problem will be resolved.

Modify config/elasticsearch.yml in the elasticsearch directory.

Uncomment cluster.name: elasticsearch and change it to something like cluster.name: your_hostname

Then try starting elasticsearch again.

+3
source share

Your ElasticSearch instance is trying to join the cluster (perhaps someone else on your network), but it fails. You must disable automatic cluster detection.

  • Locate the "Opening" section in /etc/elasticsearch/elasticsearch.yml

  • Disable multicast detection (enabled by default) by uncommenting this line:

# discovery.zen.ping.multicast.enabled: false

EDIT . I just found that this error can still occur even if "zen multicast detection" is disabled. If (like me) you have network.bind_host: 127.0.0.1 in elasticsearch.yml (to allow local connections to ElasticSearch), you should also set network.host: 127.0.0.1 . Otherwise, ElasticSearch will not be able to connect to itself (for some reason it should be).

+13
source share

Someone on your network is running elasticsearch and you cannot contact your server. Set the cluster name to something else and you will not run into this problem:

 bin/elasticsearch --Des.cluster.name=your_name 

When the ES starts up, it uses multicast discovery to look for other nodes with the same cluster name. There is a default elasticsearch cluster name, so multicast works and finds another ES node. When you try to join it, it switches to TCP and tries to connect directly to the IP address, and your network topology prevents it (therefore, there is no route to the host).

0
source share

All Articles