Java.lang.RuntimeException: java.net.ConnectException


#1

Hey, I’m trying to run this simple code… for some reason it takes a lot of time to open the bucket and then i immediately get this exception:
Any ideas what could be the problem?

CODE:
Cluster cluster = CouchbaseCluster.create(DefaultCouchbaseEnvironment.builder().
connectTimeout(100000000).managementTimeout(100000000).queryTimeout(1000000000)
.socketConnectTimeout(1000000000)// 10000ms = 10s, default is 5s
.queryEnabled(true).build(),new String[]{“xx.xxx.xxx.xxx”,“yy.yyy.yyy.yyy”});
System.out.println(“1”);
Bucket bucket = cluster.openBucket(“stats”);
System.out.println(“XXX”);
System.out.println(bucket.bucketManager().getDesignDocuments().size());

EXCEPTION:

Exception in thread “main” java.lang.RuntimeException: java.net.ConnectException: Connection timed out: no further information: /ZZZ.ZZ.Z.ZZZ:8091
at com.couchbase.client.java.util.Blocking.blockForSingle(Blocking.java:86)
at com.couchbase.client.java.bucket.DefaultBucketManager.getDesignDocuments(DefaultBucketManager.java:136)
at com.couchbase.client.java.bucket.DefaultBucketManager.getDesignDocuments(DefaultBucketManager.java:66)
at com.lubdub.utils.couchBase.couchBaseUtil.main(couchBaseUtil.java:28)
Caused by: java.net.ConnectException: Connection timed out: no further information: /ZZZ.ZZ.Z.ZZZ:8091
at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:717)
at com.couchbase.client.deps.io.netty.channel.socket.nio.NioSocketChannel.doFinishConnect(NioSocketChannel.java:224)
at com.couchbase.client.deps.io.netty.channel.nio.AbstractNioChannel$AbstractNioUnsafe.finishConnect(AbstractNioChannel.java:289)
at com.couchbase.client.deps.io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:528)
at com.couchbase.client.deps.io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:468)
at com.couchbase.client.deps.io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:382)
at com.couchbase.client.deps.io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:354)
at com.couchbase.client.deps.io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:112)
at com.couchbase.client.deps.io.netty.util.concurrent.DefaultThreadFactory$DefaultRunnableDecorator.run(DefaultThreadFactory.java:137)
at java.lang.Thread.run(Thread.java:745)


#2

It looks like you provide two IPs in the cluster, which contains at least a third node, the Z one. Is the Z ip reachable from your client machine? on any couchbase port (essentially 11210, 8091, 8092, 8093…)?


#3

Sorry for the late reply, i wasn’t around lately
The cluster contian 6 nodes. The Z ip is reachable from my client machine on 8091. @simonbasle


#4

the stack trace indicates that the network component couldn’t establish a connection to that IP on port 8091, so I think there is something going on at the network level…