Cluster doesn't work when I use CouchbaseClientConfiguration created in code to create CouchbaseClient

We need to configure and create Couchbase Client in runtime. I create new CouchbaseClientConfiguration :

var config = new CouchbaseClientConfiguration();
config.Urls.Add(new Uri(_couchbaseClientSettings.Uri));
config.Bucket = _couchbaseClientSettings.Bucket;
config.Username = _couchbaseClientSettings.Username;
config.Password = _couchbaseClientSettings.Password;

var client = new CouchbaseClient(config);

But this client is unable to find another couchbase node in cluster if the node it was pointed to in configuration file is down.

When I create Couchbase client with CouchbaseClientSection from Web.config there is no such problem.

I was able to resolve the issue by explicitly creating NodeLocatorFactory in code:

config.NodeLocatorFactory = new KetamaNodeLocatorFactory();

And after that it works fine.
But it is still magic and seems like a bug.

0 Answers

No answers yet