How to setup DefaultCouchbaseEnvironment for 4 Nodes 2 Data , 1 Index and 1 Query?


We like to test CB 4.0 4 node cluster with Java SDK 2.1.3
cb-1 and cb-2 are configured to serve Data
cb-3 to serve Index
cb-4 to serve Queries

And cant get Connection stared any help is welcome .

the we do it now is

    public void init() {
        try {
            XMLConfiguration config = new XMLConfiguration("couch-config.xml");
            String ip = config.getString("couch-ip");
            Integer httpPort = Integer.parseInt(config.getString("couch-http-port"));
            Integer currierPort = Integer.parseInt(config.getString("couch-carrier-port"));

            env = DefaultCouchbaseEnvironment
//                    .keepAliveInterval(60000)
//                    .retryStrategy(FailFastRetryStrategy.INSTANCE)

            if ( env != null ) {
                cluster = CouchbaseCluster.create(env, "", "", "", ""  );

                bucketFeederName = config.getString("bucket-feeder");
                bucketChallengeName = config.getString("bucket-challenge");

                if (cluster != null && bucketChallengeName != null) {
        } catch (Exception e) {

And can’t find the Query node on 8093 .

2015-06-26 14:19:49,962 INFO [com.couchbase.client.core.CouchbaseCore] (ServerService Thread Pool – 114) CouchbaseEnvironment: {sslEnabled=false, sslKeystoreFile=‘null’, sslKeystorePassword=‘null’, queryEnabled=true, queryPort=8093, bootstrapHttpEnabled=true, bootstrapCarrierEnabled=true, bootstrapHttpDirectPort=8091, bootstrapHttpSslPort=18091, bootstrapCarrierDirectPort=11210, bootstrapCarrierSslPort=11207, ioPoolSize=4, computationPoolSize=4, responseBufferSize=16384, requestBufferSize=16384, kvServiceEndpoints=1, viewServiceEndpoints=1, queryServiceEndpoints=1, ioPool=NioEventLoopGroup, coreScheduler=CoreScheduler, eventBus=DefaultEventBus, packageNameAndVersion=couchbase-java-client/2.1.2 (git: 2.1.2), dcpEnabled=false, retryStrategy=BestEffort, maxRequestLifetime=75000, retryDelay=com.couchbase.client.core.time.ExponentialDelay@771b963, reconnectDelay=com.couchbase.client.core.time.ExponentialDelay@3b421666, observeIntervalDelay=com.couchbase.client.core.time.ExponentialDelay@6fcca0ee, keepAliveInterval=30000, autoreleaseAfter=2000, bufferPoolingEnabled=true, queryTimeout=75000, viewTimeout=75000, kvTimeout=2500, connectTimeout=5000, disconnectTimeout=25000, dnsSrvEnabled=false}
2015-06-26 14:19:50,028 INFO [com.betiator.nosql.CouchBaseEntityManager] (ServerService Thread Pool – 114) Create View: Challenge
2015-06-26 14:19:50,172 INFO [com.couchbase.client.core.node.Node] (cb-io-1-1) Connected to Node
2015-06-26 14:19:50,173 INFO [com.couchbase.client.core.node.Node] (cb-io-1-4) Connected to Node
2015-06-26 14:19:50,172 INFO [com.couchbase.client.core.node.Node] (cb-io-1-3) Connected to Node
2015-06-26 14:19:50,173 INFO [com.couchbase.client.core.node.Node] (cb-io-1-2) Connected to Node
2015-06-26 14:19:50,190 INFO [com.couchbase.client.core.node.Node] (cb-io-1-3) Disconnected from Node
2015-06-26 14:19:50,192 INFO [com.couchbase.client.core.node.Node] (cb-io-1-1) Disconnected from Node
2015-06-26 14:19:50,205 INFO [com.couchbase.client.core.node.Node] (cb-io-1-2) Connected to Node
2015-06-26 14:19:50,206 INFO [com.couchbase.client.core.node.Node] (cb-io-1-1) Connected to Node
2015-06-26 14:19:50,391 WARN [com.couchbase.client.core.endpoint.Endpoint] (cb-io-1-2) [null][QueryEndpoint]: Could not connect to endpoint, retrying with delay 32 MILLISECONDS: : Connection refused:
at Method) [rt.jar:1.7.0_79]
at [rt.jar:1.7.0_79]
at [core-io-1.1.2.jar:1.1.2]
at$AbstractNioUnsafe.finishConnect( [core-io-1.1.2.jar:1.1.2]
at [core-io-1.1.2.jar:1.1.2]
at [core-io-1.1.2.jar:1.1.2]
at [core-io-1.1.2.jar:1.1.2]
at [core-io-1.1.2.jar:1.1.2]
at$ [core-io-1.1.2.jar:1.1.2]
at$ [core-io-1.1.2.jar:1.1.2]
at [rt.jar:1.7.0_79]


@GeorgeLeon, if you are using it against a 4.0 server, you don’t need to use queryEnabled at all, it will pick up all the services as advertised from the server. Please make sure to run 2.1.3 and if it still doesn’t work, can you enable TRACE logging and upload those logs somewhere? Thanks!


Yes you are correct !!! I removed the queryEnabled as it was checking all ports and it worked thanks


@GeorgeLeon great to hear. We’ll deprecate those options in 2.2, since they are not needed anymore.