我正在尝试连接到我的 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/