.NET Couchbase客户端连接到Couchbase服务器时出现滑动错误

本文关键字:Couchbase 错误 服务器 客户端 连接 NET | 更新日期: 2023-09-27 18:20:58

我有两个服务器。其中一个充当使用.NET客户端连接到沙发床服务器的客户端。另一个是已配置的沙发床服务器。这些服务器托管在AmazonEC2中。目前,我已经打开了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>

.NET Couchbase客户端连接到Couchbase服务器时出现滑动错误

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

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

  • SsLPort:1207
  • ApiPort:8092
  • 管理端口:8091
  • 直接端口:11210
  • https管理端口:18091
  • https Api端口:18092

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