.NET中的多个Couchbase存储桶配置 [英] Multiple Couchbase bucket configuration in .NET

查看:125
本文介绍了.NET中的多个Couchbase存储桶配置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I have 2 buckets in Couchbase one is Couchbase type and the other is Memcachced type: when I run my test I get an error: The element servers may only appear once in this section. Below is my config:

  <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.


推荐答案

来自文档,看来您可以这样做:

From the documentation, it looks like you can do it like this:

<?xml version="1.0"?>
<configuration>
  <configSections>
    <sectionGroup name="couchbase">
      <section name="bucket-a" type="Couchbase.Configuration.CouchbaseClientSection, Couchbase"/>
      <section name="bucket-b" type="Couchbase.Configuration.CouchbaseClientSection, Couchbase"/>
    </sectionGroup>
  </configSections>

  <couchbase>
    <bucket-a>
      <servers bucket="default">
        <add uri="http://127.0.0.1:8091/pools" />
      </servers>
    </bucket-a>
    <bucket-b>
      <servers bucket="beernique" bucketPassword="b33rs">
        <add uri="http://127.0.0.1:8091/pools" />
      </servers>
    </bucket-b>
  </couchbase>

  <startup>
    <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
  </startup>
</configuration>

这篇关于.NET中的多个Couchbase存储桶配置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆