Integration multi-node Couchbase with Springboot

I am new to Couchbase and integrating local Couchbase server from my Springboot application.

I initially had single node running and my application was able to insert documents using CrudRepository.

I recently configured multiple nodes on my localhost using Docker images, but now my Springboot application doesn’t work as expected.

Relevant section of my logs attached, according to which it looks like the service connects to all 3 nodes, but then immediately disconnects. for some reason

My config class looks like this…

public class CouchbaseConfig extends AbstractCouchbaseConfiguration {

@Override
public String getConnectionString() {
     return "127.0.0.1";
}

@Override
public String getUserName() {
    return "Administrator";
}

@Override
public String getPassword() {
    return "password";
}

@Override
public String getBucketName() {
    return "bucket";
}

}

Any helpful tips would be appreciated.

Many Thanks

Still no help on this :frowning:
Looking at the couchbase logs, it could be due to an unexpected ServiceDisconnectInitiatedEvent being published, still struggling with this

Is your Spring Boot application also running inside the Docker host? Or is it just Couchbase running in Docker. As you’ve described it, it sounds like a very common issue with the latter case. Any Couchbase client (Spring, Java, .NET, whatever) needs to have access to every node in the cluster.

Just the couchbase nodes are running in Docker. Saw a couple of forums talking about the same issue, so it could be a common one, however I haven’t been able to find a solution yet :frowning:

@couchBaseDev,

One solution is to also run your Spring app inside of the docker host (I’ve seen devs use docker-compose for this, but you don’t necessarily have to do that). See https://docs.couchbase.com/server/current/install/getting-started-docker.html (specifically “Deploy a Multi-Node Cluster with Containers”)