Spring-data-couchbase 4.4.7 ,Spring boot 2.7.3 configure failover cluster

Using Spring-data-couchbase 4 to connect CB. I need to configure failover cluster.

@mreiche followed your posts but probably missing something. Will it be possible to check on this?

What documentation are you following? There is no Spring-Data-Couchbase specific “failover cluster” feature.
AmbiguousTimeoutException just means that the operation did not succeed within the timeout. Refer to the details in that exception for the underlying cause - or other exceptions/messages that occurred while the client was trying to connect. In your case it is likely that the client is not able to connect to the server. Use SDK Doctor to give more diagnostics.

  • Mike

Thank you @mreiche for the quick response . I was following Connecting to multiple buckets on Couchbase cluster with Spring - Stack Overflow . Using repo to connect primary cluster works but same config with reactivecbreactivetemplate does not. Anyway for failover cluster implementation you suggest to use SDK instead of using spring data cb …. Isn’t it?

If the SDK cannot connect to the cluster, then you’ll have to reconcile that between your connection properties and your cluster. The “connecting to mulitple buckets” is for connecting to multiple buckets in the same cluster. Connecting to a bucket in a different cluster will require a different connection string (and possibly a different username/password and bucket name). In the multibucket example refer to

public CouchbaseClientFactory myCouchbaseClientFactory(String bucketName) {
    return new SimpleCouchbaseClientFactory(getConnectionString(), authenticator(), bucketName);

Given that mapping with configureRepositoryOperationsMapping is based on the entity type, the only way to map to a different cluster would be by using a different entity type when you wanted to fail-over to the other cluster, which does not sound pratical.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.