步骤 1:配置亚马逊密钥空间以便与 Apache Cassandra Spark Connector 集成 - Amazon Keyspaces (for Apache Cassandra)
Amazon Web Services 文档中描述的 Amazon Web Services 服务或功能可能因区域而异。要查看适用于中国区域的差异,请参阅 中国的 Amazon Web Services 服务入门 (PDF)

本文属于机器翻译版本。若本译文内容与英语原文存在差异,则一律以英文原文为准。

步骤 1:配置亚马逊密钥空间以便与 Apache Cassandra Spark Connector 集成

在此步骤中,您确认账户的分区器与 Apache Spark 连接器兼容,并设置所需的 IAM 权限。以下最佳做法可帮助您为表预置足够的读取/写入容量。

  1. 确认Murmur3Partitioner分区器是您账户的默认分区器。此分区器与 Spark Cassandra Connector 兼容。有关分区器及其更改方法的更多信息,请参阅在 Amazon Keyspaces 中使用分区器

  2. 使用 Apache Spark 使用接口 VPC 终端节点为亚马逊密钥空间设置 IAM 权限。

    • 为用户表分配读取/写入权限和对系统表的读取权限,如下面列出的 IAM 策略示例所示。

    • 使用 Spark 访问亚马逊密钥空间的客户端需要使用您的可用接口 VPC 终端节点填充 system.peers 表VPC 端点

    { "Version":"2012-10-17", "Statement":[ { "Effect":"Allow", "Action":[ "cassandra:Select", "cassandra:Modify" ], "Resource":[ "arn:aws:cassandra:us-east-1:111122223333:/keyspace/mykeyspace/table/mytable", "arn:aws:cassandra:us-east-1:111122223333:/keyspace/system*" ] }, { "Sid":"ListVPCEndpoints", "Effect":"Allow", "Action":[ "ec2:DescribeNetworkInterfaces", "ec2:DescribeVpcEndpoints" ], "Resource":"*" } ] }
  3. 考虑以下最佳实践,为您的 Amazon Keyspaces 表配置足够的读取/写入吞吐量以支持来自 Spark Cassandra 连接器的流量。