Hi,
I have couchbase server in kubernetes pod, I am trying to query the bucket from my local machine.
I am using the java client version 2.7.0 and my couchbase server version is 6.6
I am using the following code to open the bucket.
Cluster cluster = CouchbaseCluster.create(DefaultCouchbaseEnvironment.builder()
.bootstrapCarrierDirectPort(carrierPort)
.bootstrapHttpDirectPort(httpPort)
.networkResolution(NetworkResolution.EXTERNAL)
.kvTimeout(600000)
.queryTimeout(600000)
.connectTimeout(600000).build(),"kubernetes_node_ip");
.cluster.authenticate("admin", "password");
Bucket bucket = cluster.openBucket("bucket_name");
String query = "SELECT * FROM `bucket_name`";
N1qlQuery n1qlQuery = N1qlQuery.simple(query);
N1qlQueryResult queryResult = bucket.query(n1qlQuery);
I have also added the entry to set up alternate address on server.
curl -v -X PUT -u admin:password \
http://<ip>:<http_port>/node/controller/setupAlternateAddresses/external \
-d hostname=<ip> \
-d kv=<carrier_port> \
-d mgmt=<http_port>
On executing bucket.query(n1qlQuery), getting error.
Caused by: java.util.concurrent.TimeoutException: {"b":"bucket_name","s":"n1ql","t":75000000,"i":"8cc7c989-1421-456a-8ad6-5e05c881ebd2"}
Please let me know if I am missing something.
Thanks in advance.