CouchbaseCluster setup for multiple nodes running data, query, index and analytics


#1

Using java-client-2.7.0

In our cluster, there are 4 nodes running data, query, index and analytics.

10.xx.xx.xx -> data
10.xx.xx.xx -> query
10.xx.xx.xx -> index
10.xx.xx.xx -> analytics

What is the correct way to create com.couchbase.client.java.Cluster? Pass each IP address to CouchbaseCluster.create() method as an array of string?

Cluster cluster = CouchbaseCluster.create(“10.xx.xx.xx”, “10.xx.xx.xx”, “10.xx.xx.xx”, “10.xx.xx.xx”);

Is the above statement correct?


#2

Hi Dony,

Yes, that should work.

You can pass only one of the addresses if you want, but then the client won’t be able to find the cluster if that one node is offline.

For a deep dive into this topic, check out Michael Nitschinger’s blog post:
https://blog.couchbase.com/inside-the-java-sdk-bootstrap/

Thanks,
David


#3

Thanks for the reply, David.