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
错误。我的凭证字典错了吗?密钥不是用户名和密码而不是值?