.NET中的多个Couchbase存储桶配置

use*_*099 5 config bucket couchbase

我在Couchbase中有两个桶,一个是Couchbase类型,另一个是Memcachced类型:当我运行我的测试时,我收到一个错误:元素服务器可能只在本节中出现一次.以下是我的配置:

  <couchbase>
    <servers bucket="RepositoryCache" bucketPassword="">
      <add uri="http://127.0.0.1:8091/pools/default"/>
    </servers>

    <servers bucket="default" bucketPassword="">
      <add uri="http://127.0.0.1:8091/pools/default"/>
    </servers>
  </couchbase>

 How to configure multiple buckets and resolve the issue? I hv read the manual and I could not find much help.
Run Code Online (Sandbox Code Playgroud)

m03*_*eek 0

我之前曾在 .NET app.config 中的 Couchbase 多个存储桶中问过这个问题,但没有人回答。

我快速浏览了 couchbase .net 库的 ClientConfigurationSection,在配置的“couchbase”部分中,您只能定义一台服务器。

因此,您可以定义一个“默认”存储桶来存储另一个存储桶的连接参数。或硬编码连接设置。或者创建自己的 xml 文件,该文件将包含连接参数,并且看起来像上面发布的配置。