0
我正在嘗試使用Cassandraemon連接到C#.NET中的Cassandra實例。我找不到任何允許您指定憑據的示例。我的Cassandra實例在AWS的服務器上運行,我需要傳遞用戶名/密碼才能連接。我有以下代碼:如何將憑證傳遞給Cassandraemon中的CassandraContext?
var builder = new CassandraConnectionConfigBuilder
{
Hosts = new[] { "cassandra.myinstance.com" },
ConsistencyLevel = ConsistencyLevel.QUORUM,
Timeout = TimeSpan.FromSeconds(100),
Keyspace = "mykeyspace"
};
var config = new CassandraConnectionConfig(builder);
using (var context = new CassandraContext(config))
{
Dictionary<string, string> credentials = new Dictionary<string, string>();
credentials.Add("username", "password");
context.Login(credentials);
}
當我運行此,我上context.Login(credentials)
線的Apache.Cassandra.AuthenticationException
錯誤。我的憑證字典錯了嗎?密鑰不是用戶名和密碼而不是值?