Hello,
I have a Couchbase 3.0.2 cluster and trying to work with a memcached bucket using the .NET SDK 2.0.2. Here’s my code:
var config = new ClientConfiguration
{
Servers = new List<Uri>
{
new Uri("http://172.0.0.1:8091/pools"),
new Uri("http://172.0.0.2:8091/pools"),
new Uri("http://172.0.0.3:8091/pools"),
},
BucketConfigs = new Dictionary<string, BucketConfiguration>
{
{
"default",
new BucketConfiguration
{
BucketName = "distributed_cache",
Password = "some secret",
}
}
},
};
var cluster = new Cluster(config);
var bucketName = config.BucketConfigs.Single().Value.BucketName;
var bucket = cluster.OpenBucket(bucketName);
var result = bucket.Get<string>("some_key");
The OpenBucket
method throws the following exception:
Unhandled Exception: System.AggregateException: Could not bootstrap - check inner exceptions for details. ---> Couchbase.Configuration.ConfigException: is this a Memcached bucket?
at Couchbase.Configuration.Server.Providers.CarrierPublication.CarrierPublicationProvider.GetConfig(String bucketName, String password) in d:\work\couchbase-net-client-2.0\Src\Couchbase\Configuration\Server\Providers\CarrierPublication\CarrierPublicationProvider.cs:line 171
at Couchbase.Core.ClusterController.CreateBucket(String bucketName, String password) in d:\work\couchbase-net-client-2.0\Src\Couchbase\Core\ClusterController.cs:line 163
The exact same code works just fine with Couchbase buckets. Is there some specific way to configure a memcached bucket? Maybe the server urls that are passed should be different and not /pools
?
Remark: I was able to successfully consume this memcached bucket from the Java SDK 2.0.