【问题标题】:.NET Couchbase client slitent error connecting to Couchbase server.NET Couchbase 客户端连接到 Couchbase 服务器时出现错误
【发布时间】:2014-09-06 22:17:41
【问题描述】:

我有两台服务器。其中一个充当使用 .NET 客户端连接到 couchbase 服务器的客户端。另一个是已配置的 couchbase 服务器。这些服务器托管在 Amazon EC2 中。现在我已经打开了 couchbase 服务器上的所有端口。但是,当我尝试使用 .NET 客户端进行连接时,初始化代码会挂起并且不会引发任何错误。除了 get 总是返回 null 之外,它还允许我保存和获取没有错误。我已经验证了 IP 和端口是可以访问和打开的。

这是我正在尝试的代码。

CouchbaseClient = new CouchbaseClient("api_cache",""); //hangs for about 10 seconds throws no error
CouchbaseClient.Store(StoreMode.Set, "test","test")); //throws no error;
var test = CouchbaseClient.Get("test"); //always returns null;

这是我的 web.config 中的代码

  <configSections>
    <section name="couchbase" type="Couchbase.Configuration.CouchbaseClientSection, Couchbase" />

    <!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
    <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
    <!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
  </configSections>
  <appSettings>

  </appSettings>
  <couchbase>
    <servers>
      <add uri="http://XX.XX.XX.XX:8091/pools" />
    </servers>
  </couchbase>

....

【问题讨论】:

    标签: c# amazon-ec2 client-server couchbase


    【解决方案1】:

    这基本上是一个端口阻塞问题。为了我的使用,我需要打开直接端口。

    我下载了.NET客户端源代码,发现对以下端口的引用:

    • SsLPort: 11207
    • API 端口:8092
    • 管理端口:8091
    • 直接端口:11210
    • https 管理端口:18091
    • https API 端口:18092

    我也在 Couchbase 社区上发布了这个问题的答案。 http://www.couchbase.com/communities/q-and-a/i-cannot-connect-couchbase-server-amazon-ec2

    【讨论】:

    • 感谢 @CodeMilian 也回帖到 Couchbase 社区
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-03-21
    • 1970-01-01
    • 1970-01-01
    • 2022-01-20
    • 1970-01-01
    • 2014-10-05
    相关资源
    最近更新 更多