【问题标题】:Could not bootstrap with CCCP : Couchbase memcached bucket exception无法使用 CCCP 引导:Couchbase memcached 存储桶异常
【发布时间】:2019-02-10 06:05:39
【问题描述】:

我正在使用最新版本的 CouchbaseNetClient NuGet 包 2.7.4 连接 Couchbase 4.6.3 企业版(在我笔记本电脑的 docker 上运行)。 C#代码:

var config = new ClientConfiguration
            {
                // assign one or more Couchbase Server URIs available for bootstrap
                Servers = new List<Uri>
                {
                    new Uri("http://192.168.99.100:8091/")
                },
                BucketConfigs = new Dictionary<string, BucketConfiguration> {
                    {"memcachetest", new BucketConfiguration {
                        PoolConfiguration = new PoolConfiguration {
                            MaxSize = 6,
                            MinSize = 4,
                            SendTimeout = 12000
                        },
                        Port = 8091,
                        DefaultOperationLifespan = 123,
                        Password = "",
                        Username = "",
                        BucketName = "memcachetest"
                    }}},
                UseSsl = false,
            };
            ClusterHelper.Initialize(config);

此代码适用于普通存储桶(下面的示例存储桶),但我无法连接到 Memcached(memcachetest) 存储桶。

下面这行在开桶时抛出各种异常。

private readonly IBucket _bucket = ClusterHelper.GetBucket("memcachetest", "");

我尝试过使用/不使用密码。从过去的两天开始,这一切都在我的脑海中!任何帮助appriciated!

【问题讨论】:

  • 您想使用 memcache 存储桶而不是 Couchbase 存储桶的任何特定原因?

标签: c# couchbase


【解决方案1】:

Memcached 存储桶不支持 CCCP。客户端将首先尝试 CCCP,然后在 CCCP 失败时转移到 HTTP 流 - 这会被记录下来,并且可能是您偶然发现的。由于它是一个 AggregateException,看来它失败的原因可能还有其他原因 - 您必须查看每个异常的原因。请注意,您可以通过将 ConfigurationProviders 设置为 HttpStreaming 来跳过 Memcached 存储桶的 CCCP:

ClientConfiguration.ConfigurationProviders = ServerConfigurationProviders.HttpStreaming;

【讨论】:

  • 它的问题在于 couchbase 服务器的 docker 实例。我可能需要在 memcache 存储桶使用的 dicker 容器上启用端口
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2015-06-19
  • 1970-01-01
  • 1970-01-01
  • 2023-03-13
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多