简体   繁体   English

我应该为 Amazon Keyspaces(托管 Cassandra)使用哪个用户名和密码?

[英]Which username and password should I use for Amazon Keyspaces (managed Cassandra)?

I am unable to connect to AWS Keyspaces using .NET Core due to an authentication error:由于身份验证错误,我无法使用 .NET Core 连接到 AWS Keyspaces:

AuthenticationException 'Provided username nick and/or password are incorrect') AuthenticationException '提供的用户名 nick 和/或密码不正确')

I am not sure what values I should give to PlainTextAuthProvider .我不确定应该给PlainTextAuthProvider什么值。

I have tried using:我试过使用:

  • My AWS Console credentials我的 AWS 控制台凭证
  • AWS access key / secret key pair AWS 访问密钥/秘密密钥对

How do I generate credentials for AWS Keyspaces?如何为 AWS Keyspaces 生成凭证?


My code, in case it is relevant:我的代码,如果它是相关的:

open System
open Cassandra

[<EntryPoint>]
let main argv = 
  async {    
    let cluster =
      Cluster.Builder()
        .AddContactPoints("cassandra.eu-west-2.amazonaws.com")
        .WithPort(9142)
        .WithAuthProvider(PlainTextAuthProvider ("username", "password123"))
        .WithSSL()
        .Build()

    use! session =
      cluster.ConnectAsync ()
      |> Async.AwaitTask

    ()
  }
  |> Async.RunSynchronously

  0

The option is found in the IAM section .该选项位于IAM 部分

Naviagate to:导航至:

  • "Services" drop-down “服务”下拉菜单
  • Click "Identity and Access Management (IAM)"单击“身份和访问管理 (IAM)”
  • Open the "Users" tab打开“用户”选项卡
  • Click on You username点击你的用户名
  • Open the "Security credentials" tab打开“安全凭据”选项卡
  • Scroll to the "Credentials for Amazon Keyspaces" section滚动到“Amazon Keyspaces 的凭据”部分
  • Click "Generate Credentials"点击“生成凭证”

在此处输入图像描述

This will show a pop-up where you can generate credentials.这将显示一个弹出窗口,您可以在其中生成凭据。


Additionally, the code should specify a Keyspace:此外,代码应指定一个 Keyspace:

open System
open Cassandra

[<EntryPoint>]
let main argv = 
  async {    
    let cluster =
      Cluster.Builder()
        .AddContactPoints("cassandra.eu-west-2.amazonaws.com")
        .WithPort(9142)
        .WithAuthProvider(PlainTextAuthProvider ("username", "password123"))
        .WithSSL()
        .Build()

    use! session =
      cluster.ConnectAsync "test_keyspace"
      |> Async.AwaitTask

    ()
  }
  |> Async.RunSynchronously

  0

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 不支持使用 Amazon Keyspaces 的分区程序(对于 Apache Cassandra) - Unsupported partitioner with Amazon Keyspaces (for Apache Cassandra) 如果我想将 Cassandra 迁移到 AMAZON KEYSPACES,我可以预期多长时间的应用程序停机时间? - How much application downtime I can expect if I want to migrate Cassandra to AMAZON KEYSPACES? 当我尝试使用 Pyspark 从 Amazon Keyspaces 获取数据时,出现不支持的分区程序:com.amazonaws.cassandra.DefaultPartitioner 错误 - When I try fetch data from Amazon Keyspaces with Pyspark, I get Unsupported partitioner: com.amazonaws.cassandra.DefaultPartitioner Error 尝试从 linux 使用 .net core 和 cassandra csharp 驱动程序连接到 Amazon Keyspaces 时出现身份验证异常 - Authentication Exception when trying to connect to Amazon Keyspaces using .net core and cassandra csharp driver from linux Heroku或Amazon托管后端Rails JSON API? 我应该使用哪个? - Heroku or Amazon to host a backend Rails JSON API? Which should I use? 在 Amazon Keyspaces 上启用 Json Insert - Enable Json Insert on Amazon Keyspaces Amazon Cognito使用用​​户名和密码登录用户 - Amazon Cognito log users in with username and password 将 Cassandra 数据库迁移到 AWS Keyspaces 后如何检查数据完整性 - How do I check the data integrity after migrating a Cassandra database onto AWS Keyspaces 我应该将Amazon S3存储桶放在哪个区域? - in which region should I put my amazon s3 bucket? 将 cassandra-stress 连接到 AWS Keyspaces - Connecting cassandra-stress to AWS Keyspaces
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM