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


#1

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

@PostConstruct
    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
                    .builder()
                    .bootstrapHttpEnabled(true)
                    .bootstrapHttpDirectPort(httpPort)
                    .bootstrapCarrierEnabled(true)
                    .bootstrapCarrierDirectPort(currierPort)
                    .queryEnabled(true)
//                    .keepAliveInterval(60000)
//                    .retryStrategy(FailFastRetryStrategy.INSTANCE)
                    .build();

            if ( env != null ) {
                cluster = CouchbaseCluster.create(env, "192.168.1.229", "192.168.1.233", "192.168.1.231", "192.168.1.232"  );

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

                if (cluster != null && bucketChallengeName != null) {
                    createChallengeViews();
                }
            }
        } catch (Exception e) {
            LOGGER.error(e.getMessage());
        }
    }

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 cb-4.betiator.com
2015-06-26 14:19:50,173 INFO [com.couchbase.client.core.node.Node] (cb-io-1-4) Connected to Node cb-1.betiator.com
2015-06-26 14:19:50,172 INFO [com.couchbase.client.core.node.Node] (cb-io-1-3) Connected to Node cb-3.betiator.com
2015-06-26 14:19:50,173 INFO [com.couchbase.client.core.node.Node] (cb-io-1-2) Connected to Node cb-2.betiator.com
2015-06-26 14:19:50,190 INFO [com.couchbase.client.core.node.Node] (cb-io-1-3) Disconnected from Node cb-3.betiator.com
2015-06-26 14:19:50,192 INFO [com.couchbase.client.core.node.Node] (cb-io-1-1) Disconnected from Node cb-4.betiator.com
2015-06-26 14:19:50,205 INFO [com.couchbase.client.core.node.Node] (cb-io-1-2) Connected to Node cb-4.betiator.com
2015-06-26 14:19:50,206 INFO [com.couchbase.client.core.node.Node] (cb-io-1-1) Connected to Node cb-3.betiator.com
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: : java.net.ConnectException: Connection refused: cb-1.betiator.com/192.168.1.233:8093
at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method) [rt.jar:1.7.0_79]
at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:739) [rt.jar:1.7.0_79]
at com.couchbase.client.deps.io.netty.channel.socket.nio.NioSocketChannel.doFinishConnect(NioSocketChannel.java:208) [core-io-1.1.2.jar:1.1.2]
at com.couchbase.client.deps.io.netty.channel.nio.AbstractNioChannel$AbstractNioUnsafe.finishConnect(AbstractNioChannel.java:281) [core-io-1.1.2.jar:1.1.2]
at com.couchbase.client.deps.io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:528) [core-io-1.1.2.jar:1.1.2]
at com.couchbase.client.deps.io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:468) [core-io-1.1.2.jar:1.1.2]
at com.couchbase.client.deps.io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:382) [core-io-1.1.2.jar:1.1.2]
at com.couchbase.client.deps.io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:354) [core-io-1.1.2.jar:1.1.2]
at com.couchbase.client.deps.io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:116) [core-io-1.1.2.jar:1.1.2]
at com.couchbase.client.deps.io.netty.util.concurrent.DefaultThreadFactory$DefaultRunnableDecorator.run(DefaultThreadFactory.java:137) [core-io-1.1.2.jar:1.1.2]
at java.lang.Thread.run(Thread.java:745) [rt.jar:1.7.0_79]


#2

@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!


#3

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


#4

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