amazon-web-services - 下沉到 Kinesis 时,具有自定义规则的 Amazon DMS 任务失败

标签 amazon-web-services aws-dms amazon-dms

我正在尝试使用 Amazon DMS 监听 Aurora 数据库更改并将更改推送到 Kinesis 流,其中监听流的 Lambda 函数将进行处理。

我指的是下面的文档来编写我的规则。

https://docs.aws.amazon.com/dms/latest/userguide/CHAP_Target.Kinesis.html
https://aws.amazon.com/blogs/database/use-the-aws-database-migration-service-to-stream-change-data-to-amazon-kinesis-data-streams/

这是我的 DMS 持续复制 (CDC) 任务的规则映射。

{
    "rules": [
        {
            "rule-type": "selection",
            "rule-id": "1",
            "rule-name": "1",
            "object-locator": {
                "schema-name": "my_db",
                "table-name": "my_table"
            },
            "rule-action": "include"
        },
        {
            "rule-type": "object-mapping",
            "rule-id": "2",
            "rule-name": "2",
            "rule-action": "map-record-to-record",
            "object-locator": {
                "schema-name": "my_db",
                "table-name": "my_table"
            },
            "mapping-parameters": {
                "partition-key": {
                    "attribute-name": "my_id",
                    "value": "${my_id}"
                }
            }
        }
    ]
}

但是,当我对源表进行更改时,DMS 任务失败并出现以下错误。
2019-02-05T10:36:55 [TARGET_APPLY ]E: Error allocating memory for Json document [1020100] (field_mapping_utils.c:382)
2019-02-05T10:36:55 [TARGET_APPLY ]E: Failed while looking for object mapping for table my_table [1020100] (kinesis_utils.c:258)
2019-02-05T10:36:55 [TARGET_APPLY ]E: Error executing data handler [1020100] (streamcomponent.c:1778)
2019-02-05T10:36:55 [TASK_MANAGER ]E: Stream component failed at subtask 0, component st_0_some_random_id [1020100] (subtask.c:1366)
2019-02-05T10:36:55 [TASK_MANAGER ]E: Task error notification received from subtask 0, thread 1 [1020100] (replicationtask.c:2661)
2019-02-05T10:36:55 [TASK_MANAGER ]W: Task 'some_random_task_id' encountered a fatal error (repository.c:4704)

当我在没有 object-mapping 的情况下尝试时规则,Kinesis 将获得记录 "partitionKey": "my_db.my_table"使用正确的值,这是 table-to-table sink 的默认行为,但我们需要 table-to-kinesis sink。

我为什么关心partition-key这么多?因为我需要利用 Kinesis 流中的所有分片。

有人能帮我吗?

更新:

当我添加 "partition-key-type": "schema-table""mapping-parameters" ,它不会失败,任务不会失败,但会忽略 "partition-key"属性并将具有 "partitionKey": "my_db.my_table"像以前一样。

不确定点:
  • 在 table-to-table 下沉中,它使用 "partition-key-type": "schema-table" ,但从未提及 table-to-kinesis 的值(value)。
  • 文档中的示例和解释非常有限,甚至是错误的(即某些规则 JSON 无效)
  • 最佳答案

    所以,我在这里回答我自己的问题。

    我们联系了 AWS Support 团队,他们说这是他们这边的问题,而且文档也没有反射(reflect)确切的功能。他们还在内部提出了一张票,并在 future 修复。

    目前,由于 DMS 无法满足我们的期望,我们决定转向不同的解决方案。

    关于amazon-web-services - 下沉到 Kinesis 时,具有自定义规则的 Amazon DMS 任务失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54535540/

    相关文章:

    javascript - ElasticSearch AWS请求超时

    amazon-web-services - 使用 AWS DMS for Postgres 到 Postgres 数据迁移时如何修复 `column "xlog_position“不存在”错误

    postgresql - AWS DMS CDC 任务不检测列名称和类型更改

    apache-kafka - AWS DMS Kafka 目标端点测试失败,显示 "application error 1020912: failed to connect to database"

    amazon-web-services - 将 DMS 连接到 S3

    amazon-s3 - 如何将包含约 50,000 个文件的整个 S3 存储桶公开?

    amazon-web-services - AWS Certificate Manager 中处于 Pending 状态的证书

    amazon-web-services - 使用 FPT/SCP 将文件拉到 S3 的最佳方法是什么?