c# - Couchbase 错误打开存储桶 - 无法引导

标签 c# couchbase

我正在尝试连接到我的 couchbase 服务器(企业版 4.6.2)并使用 .Net SDK 打开一个存储桶,代码非常简单但仍然无法工作:

        var cluster = new Cluster(new ClientConfiguration
        {
            Servers = new List<Uri> { new Uri("https://10.0.0.54:8091/") }
        });

        try
        {
            var bucket = cluster.OpenBucket("default");
        }
        catch (Exception ex)
        {
            Console.WriteLine("Error getting bucket.");
            Console.WriteLine(ex.Message);
        }

我得到的内部异常细节:

留言

Object reference not set to an instance of an object

堆栈跟踪

Couchbase.IO.Services.PooledIOService.CheckEnabledServerFeatures(IConnection connection)
   at Couchbase.IO.Services.PooledIOService..ctor(IConnectionPool connectionPool)
   at Couchbase.IO.IOServiceFactory.<>c__DisplayClass0_0.<GetFactory>b__0(IConnectionPool pool)
   at Couchbase.Configuration.Server.Providers.CarrierPublication.CarrierPublicationProvider.GetConfig(String bucketName, String username, String password)

我看到的主要异常是:

Could not bootstrap - check inner exceptions for details.

和堆栈跟踪:

   at Couchbase.Core.ClusterController.CreateBucket(String bucketName, String username, String password, IAuthenticator authenticator)
   at Couchbase.Core.ClusterController.CreateBucket(String bucketName, IAuthenticator authenticator)
   at Couchbase.Cluster.OpenBucket(String bucketname)
   at Couchbase.Program.Main(String[] args)

知道问题出在哪里吗?

最佳答案

我在使用社区版时遇到了同样的问题。在我的例子中,我在尝试访问它之前没有创建 default 存储桶。此外,如果您的服务器/集群或存储桶需要凭据,您也需要输入这些凭据。

关于c# - Couchbase 错误打开存储桶 - 无法引导,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45524726/

相关文章:

c# - Windows 窗体是否有类似 Snoop (WPF) 或 FireBug (ASP.NET) 之类的东西?

c# - 在嵌套对象的 IQueryable 上动态创建 lambda 搜索

java - 比较和交换: How to map the cas metadata field to document entity of my couchbase

couchbase - 将 N1QL 与文档键一起使用

sqlite - Couchbase 是否使用 SQLite 作为其持久层?

go - 运行 Hello Couchbase 应用程序时出现紧急运行时错误

C#:使用 FileSystemWatcher 监视复制或移动的文件

c# - 为什么我的代码停止并且不返回异常?

couchbase - 如何将 couchbase View 输出输入到另一个 View 中?

c# - NuGet 发布管理