Hi guys … i have a question. I have a cluster with 3 nodes and 2 buckets. I am trying to get the list of buckets defined in the cluster. I tried:
Cluster cluster = CouchbaseCluster.create("localhost");
ClusterManager manager = cluster.clusterManager("default", "");
manager.getBuckets().stream().map(x->x.name()).forEach(System.out::println);
But the getBuckets() method just returns 1 bucket (the default one). Is there any way to get the list of all the buckets using the Java SDK?
So, I tried the node api with the same example and I am getting different results. Maybe is a bug in the Java SDK? Where can I report this issue?
This is the example I tried in node:
var couchbase = require('couchbase');
var cluster = new couchbase.Cluster("localhost");
var manager = cluster.manager("default", "");
manager.listBuckets(function(err, r) {
r.forEach(function(c) {
console.log(c.name);
});
});
This code prints:
default
test
that are the 2 buckets i have defined. The java code just prints “default”
daschl
3
Your admin user is default? The cluster manager needs admin credentials to work properly!
No, in this case “default” is a bucket name. I tried to use the “admin” user to obtain the cluster manager and I was finally able to get both buckets.
Now, what I don’t get is why the results are different when I use the Node SDK and the Java SDK (using “default” as user).
daschl
5
Good question, maybe @brett19 has an idea? Are all buckets without password?