List of Hosts Not All in Same Cluster


What happens if the list of hosts provided when opening a cluster, e.g…

Cluster cluster = CouchbaseCluster.create(someEnvironment, hosts);

…are not actually part of the same Couchbase cluster (i.e. the hosts represent nodes in two or more clusters)?



oh you shouldn’t do that :scream_cat:

What would happen is one of the nodes in the list will be selected for bootstrap, getting the cluster map from that node and thus connecting you to one of the clusters in a non-deterministic manner.

the list of nodes is there so that if one node happens to be down during init, we still can fallback to another node to connect to the cluster.