Connecting coucbase client using alternate port than 8093

As I understand , support for queryPort was removed from DefaultCoreEnvironment, we can no longer use an alternate port for default query port of 8093. If a CouchbaseClient connection is created without queryPort , we end up seeing this error

Connection refused: eaasrt2/

Please suggest how can we get pass this issue.

NOTE : Couchbase is being connected as a docker image

Hi Mahesh,

I asked around, and apparently the Java SDK automatically gets the query port from the cluster config map. Couchbase Server tells the client what host and port to use for N1QL (and other services), and there’s no need for manual configuration.

I wonder if this could be a connectivity issue. What do you see if you try to hit the query service manually from the same machine the client is running on? (Replace the IP address / hostname as appropriate.)


If the service is running and accessible, the response should look something like

"requestID": "39611a38-00da-49d9-9aef-4a5c2b13ebdb",
"errors": [{"code":1050,"msg":"No statement or prepared value"}],
"status": "fatal",
"metrics": {"elapsedTime": "46.03µs","executionTime": "45.864µs","resultCount": 0,"resultSize": 0,"errorCount": 1}

Hi David,

Thanks for the response. Well the issue is that our CI pipeline build
machine is different from the kubernetes cluster on which couchbase is
deployed as a container. Doing what you suggested will not work unless we
do a port forward, which i am not sure will work, since there are other
builds running on same setup.

Anyhow, we managed to get around the problem by using curl to push data
into our bucket, but i really found this surprising that this feature was
removed without any alternative option or workaround for cases when java
client is to connect to a remote couchbase cluster


Sorry David pulling the old thread to see if you can answer :

I have 5 node CB cluster up in K8s and having below issue : while I am trying to connect 8093 after being inside container and using container IP . Clearly it tells me 8093 is not available . I can’t even telnet to 8093 …8091 is all good … So how to get this issue resolve to get 8093 open for N1QL ?

root@tccb-cluster-0000:/# curl
curl: (7) Failed to connect to port 8093: Connection refused

Hi @eldorado,
I’m not sure what could be causing that, but I can steer you to the Kubernetes section of the Couchbase forum where the Kubernetes experts hang out.