本文属于机器翻译版本。若本译文内容与英语原文存在差异,则一律以英文原文为准。
在亚马逊密钥空间中查看 CDC 直播
要查看或列出密钥空间中的所有流,您可以在 CQL system_schema_mcs.streams 中使用语句查询系统密钥空间中的表,或者在、或控制台中 AWS CLI使用get-stream和list-stream命令。
有关所需的权限,请参阅配置权限以在 Amazon Keyspaces 中使用 CDC 流。
- Cassandra Query Language (CQL)
-
使用 CQL 观看 CDC 直播
要监控表格的 CDC 状态,可以使用以下语句。
SELECT custom_properties FROM system_schema_mcs.tables WHERE keyspace_name='my_keyspace' and table_name='my_table';该命令的输出看起来与此相似。
... custom_properties ---------------------------------------------------------------------------------- {'cdc_specification':{'status': 'Enabled', 'view_type': 'NEW_IMAGE', 'latest_stream_arn': 'arn:aws:cassandra:us-east-1:111122223333:/keyspace/my_keyspace/table/my_table/stream/stream_label''}} ...
- CLI
-
使用以下方式观看 CDC 直播 AWS CLI
-
此示例说明如何查看表格的流信息。
aws keyspaces get-table \ --keyspace-name 'my_keyspace' \ --table-name 'my_table'该命令的输出如下所示。
{ "keyspaceName": "my_keyspace", "tableName": "my_table", ... Other fields ..., "latestStreamArn": "arn:aws:cassandra:us-east-1:111122223333:/keyspace/my_keyspace/table/my_table/stream/stream_label", "cdcSpecification": { "status": "ENABLED", "viewType": "NEW_AND_OLD_IMAGES" } } 您可以按指定列表列出您账户中的所有直播 AWS 区域。下面是一个命令示例。
aws keyspacesstreams list-streams --regionus-east-1该命令的输出可能与此相似。
{ "Streams": [ { "StreamArn": "arn:aws:cassandra:us-east-1:111122223333:/keyspace/ks_1/table/t1/stream/2023-05-11T21:21:33.291", "StreamLabel": "2023-05-11T21:21:33.291", "KeyspaceName": "ks_1" "TableName": "t1", }, { "StreamArn": "arn:aws:cassandra:us-east-1:111122223333:/keyspace/ks_1/table/t2/stream/2023-05-11T21:21:33.291", "StreamLabel": "2023-05-11T21:21:33.291", "KeyspaceName": "ks_1"Create a keyspace with the namecatalog. Note that streams are not supported in multi-Region keyspaces. "TableName": "t2", }, { "StreamArn": "arn:aws:cassandra:us-east-1:111122223333:/keyspace/ks_2/table/t1/stream/2023-05-11T21:21:33.291", "StreamLabel": "2023-05-11T21:21:33.291", "KeyspaceName": "ks_3" "TableName": "t1", } ] }您还可以使用以下参数列出给定密钥空间的 CDC 流。
aws keyspacesstreams list-streams --keyspace-name ks_1 --regionus-east-1该命令的输出看起来与此相似。
{ "Streams": [ { "StreamArn": "arn:aws:cassandra:us-east-1:111122223333:/keyspace/ks_1/table/t1/stream/2023-05-11T21:21:33.291", "StreamLabel": "2023-05-11T21:21:33.291", "KeyspaceName": "ks_1" "TableName": "t1", }, { "StreamArn": "arn:aws:cassandra:us-east-1:111122223333:/keyspace/ks_1/table/t2/stream/2023-05-11T21:21:33.291", "StreamLabel": "2023-05-11T21:21:33.291", "KeyspaceName": "ks_1" "TableName": "t2", } ] }您还可以使用以下参数列出给定表的 CDC 流。
aws keyspacesstreams list-streams --keyspace-name ks_1 --table-name t2 --regionus-east-1该命令的输出看起来与此相似。
{ "Streams": [ { "StreamArn": "arn:aws:cassandra:us-east-1:111122223333:/keyspace/ks_1/table/t2/stream/2023-05-11T21:21:33.291", "StreamLabel": "2023-05-11T21:21:33.291", "KeyspaceName": "ks_1" "TableName": "t2", } ] }
-
- Console
-
在亚马逊 Keyspaces 控制台中查看 CDC 直播
-
登录并打开 Amazon Keyspaces 控制台 AWS 管理控制台,网址为https://console.aws.amazon.com/keyspaces/home
。 在导航窗格中,选择 “表”,然后从列表中选择一个表。
选择 “直播” 选项卡以查看直播详细信息。
-
禁用 CDC 直播
访问 CDC 直播