NoNodeAvailableException


(Frank LaRosa) #1

Question - does the client need to be able to connect to all the nodes
in a cluster, or just one?

We set up a two-node cluster, but only made one node available outside
of our production firewall. I can connect to that node using curl and
run queries, but when I try to connect programatically via the Java
API, I get the "NoNodeAvailable" exception. With additional logging
enabled, I see this in my output:

01/11/2012 19:34:05 [WARN] Thread-10 (Log4jESLogger.java:105) - [Bill
Foster] Exception caught on netty layer [[id: 0x28892a87]]
java.nio.channels.UnresolvedAddressException
at sun.nio.ch.Net.checkAddress(Net.java:30)
at sun.nio.ch.SocketChannelImpl.connect(SocketChannelImpl.java:480)
at
org.elasticsearch.common.netty.channel.socket.nio.NioClientSocketPipelineSink.connect(NioClientSocketPipelineSink.java:
150)
at
org.elasticsearch.common.netty.channel.socket.nio.NioClientSocketPipelineSink.eventSunk(NioClientSocketPipelineSink.java:
113)
at
org.elasticsearch.common.netty.channel.DefaultChannelPipeline.sendDownstream(DefaultChannelPipeline.java:
574)
at
org.elasticsearch.common.netty.channel.Channels.connect(Channels.java:
541)
at
org.elasticsearch.common.netty.channel.AbstractChannel.connect(AbstractChannel.java:
210)
at
org.elasticsearch.common.netty.bootstrap.ClientBootstrap.connect(ClientBootstrap.java:
227)
at
org.elasticsearch.common.netty.bootstrap.ClientBootstrap.connect(ClientBootstrap.java:
188)
at
org.elasticsearch.transport.netty.NettyTransport.connectToChannels(NettyTransport.java:
547)
at
org.elasticsearch.transport.netty.NettyTransport.connectToNode(NettyTransport.java:
503)
at
org.elasticsearch.transport.netty.NettyTransport.connectToNode(NettyTransport.java:
482)
at
org.elasticsearch.transport.TransportService.connectToNode(TransportService.java:
124)
at org.elasticsearch.client.transport.TransportClientNodesService
$SimpleNodeSampler.sample(TransportClientNodesService.java:262)
at
org.elasticsearch.client.transport.TransportClientNodesService.addTransportAddress(TransportClientNodesService.java:
126)
at
org.elasticsearch.client.transport.TransportClient.addTransportAddress(TransportClient.java:
200)


(Shay Banon) #2

Only one node is enough. It seems like it failed ot resolve the address you
provided the TransportClient. Did you enable sniffing? If so, it will try
and connect to the publish host of the node (logged when it starts up), not
the address you provided.

On Thu, Jan 12, 2012 at 3:40 AM, Frank LaRosa frank@studyblue.com wrote:

Question - does the client need to be able to connect to all the nodes
in a cluster, or just one?

We set up a two-node cluster, but only made one node available outside
of our production firewall. I can connect to that node using curl and
run queries, but when I try to connect programatically via the Java
API, I get the "NoNodeAvailable" exception. With additional logging
enabled, I see this in my output:

01/11/2012 19:34:05 [WARN] Thread-10 (Log4jESLogger.java:105) - [Bill
Foster] Exception caught on netty layer [[id: 0x28892a87]]
java.nio.channels.UnresolvedAddressException
at sun.nio.ch.Net.checkAddress(Net.java:30)
at sun.nio.ch.SocketChannelImpl.connect(SocketChannelImpl.java:480)
at

org.elasticsearch.common.netty.channel.socket.nio.NioClientSocketPipelineSink.connect(NioClientSocketPipelineSink.java:
150)
at

org.elasticsearch.common.netty.channel.socket.nio.NioClientSocketPipelineSink.eventSunk(NioClientSocketPipelineSink.java:
113)
at

org.elasticsearch.common.netty.channel.DefaultChannelPipeline.sendDownstream(DefaultChannelPipeline.java:
574)
at
org.elasticsearch.common.netty.channel.Channels.connect(Channels.java:
541)
at

org.elasticsearch.common.netty.channel.AbstractChannel.connect(AbstractChannel.java:
210)
at

org.elasticsearch.common.netty.bootstrap.ClientBootstrap.connect(ClientBootstrap.java:
227)
at

org.elasticsearch.common.netty.bootstrap.ClientBootstrap.connect(ClientBootstrap.java:
188)
at

org.elasticsearch.transport.netty.NettyTransport.connectToChannels(NettyTransport.java:
547)
at

org.elasticsearch.transport.netty.NettyTransport.connectToNode(NettyTransport.java:
503)
at

org.elasticsearch.transport.netty.NettyTransport.connectToNode(NettyTransport.java:
482)
at

org.elasticsearch.transport.TransportService.connectToNode(TransportService.java:
124)
at org.elasticsearch.client.transport.TransportClientNodesService
$SimpleNodeSampler.sample(TransportClientNodesService.java:262)
at

org.elasticsearch.client.transport.TransportClientNodesService.addTransportAddress(TransportClientNodesService.java:
126)
at

org.elasticsearch.client.transport.TransportClient.addTransportAddress(TransportClient.java:
200)


(Karussell) #3

but only made one node available outside of our production firewall.

also ensure you have the port 9300 available + equal version on client
and server

Peter.

On 12 Jan., 02:40, Frank LaRosa fr...@studyblue.com wrote:

Question - does the client need to be able to connect to all the nodes
in a cluster, or just one?

We set up a two-node cluster, but only made one node available outside
of our production firewall. I can connect to that node using curl and
run queries, but when I try to connect programatically via the Java
API, I get the "NoNodeAvailable" exception. With additional logging
enabled, I see this in my output:

01/11/2012 19:34:05 [WARN] Thread-10 (Log4jESLogger.java:105) - [Bill
Foster] Exception caught on netty layer [[id: 0x28892a87]]
java.nio.channels.UnresolvedAddressException
at sun.nio.ch.Net.checkAddress(Net.java:30)
at sun.nio.ch.SocketChannelImpl.connect(SocketChannelImpl.java:480)
at
org.elasticsearch.common.netty.channel.socket.nio.NioClientSocketPipelineSi nk.connect(NioClientSocketPipelineSink.java:
150)
at
org.elasticsearch.common.netty.channel.socket.nio.NioClientSocketPipelineSi nk.eventSunk(NioClientSocketPipelineSink.java:
113)
at
org.elasticsearch.common.netty.channel.DefaultChannelPipeline.sendDownstrea m(DefaultChannelPipeline.java:
574)
at
org.elasticsearch.common.netty.channel.Channels.connect(Channels.java:
541)
at
org.elasticsearch.common.netty.channel.AbstractChannel.connect(AbstractChan nel.java:
210)
at
org.elasticsearch.common.netty.bootstrap.ClientBootstrap.connect(ClientBoot strap.java:
227)
at
org.elasticsearch.common.netty.bootstrap.ClientBootstrap.connect(ClientBoot strap.java:
188)
at
org.elasticsearch.transport.netty.NettyTransport.connectToChannels(NettyTra nsport.java:
547)
at
org.elasticsearch.transport.netty.NettyTransport.connectToNode(NettyTranspo rt.java:
503)
at
org.elasticsearch.transport.netty.NettyTransport.connectToNode(NettyTranspo rt.java:
482)
at
org.elasticsearch.transport.TransportService.connectToNode(TransportService .java:
124)
at org.elasticsearch.client.transport.TransportClientNodesService
$SimpleNodeSampler.sample(TransportClientNodesService.java:262)
at
org.elasticsearch.client.transport.TransportClientNodesService.addTransport Address(TransportClientNodesService.java:
126)
at
org.elasticsearch.client.transport.TransportClient.addTransportAddress(Tran sportClient.java:
200)


(system) #4