解决使用DMS进行从RDS Postgres到S3的持续复制时出现致命错误的方法

0

【以下的问题经过翻译处理】 我尝试使用[将Amazon RDS PostgreSQL DB实例设置为源][1](https://docs.aws.amazon.com/dms/latest/userguide/CHAP_Source.PostgreSQL.html#CHAP_Source.PostgreSQL.RDSPostgreSQL.CDC)来配置我的RDS PostgreSQL实例进行CDC。我配置了DMS源端点使用特定的slotName,首先使用已经存在于DB中的slot,然后使用pg_create_logical_replication_slot创建的slot。在成功测试了端点以确保连通性,我开始复制任务时加载现有数据,然后进行持续更改。但两次复制失败,显示了类似以下的致命错误,也没有复制任何数据(即使是应该已加载的现有数据)。

Last Error Stream Component Fatal error. Task error notification received from subtask 0, thread 0 [reptask/replicationtask.c:2822] [1020101] Error executing source loop; Stream component failed at subtask 0, component st_0_KVPUHIZBICJJRNGCC32HP5EFGGLIZLRF2YSRJ6Y ; Stream component 'st_0_KVPUHIZBICJJRNGCC32HP5EFGGLIZLRF2YSRJ6Y' terminated [reptask/replicationtask.c:2829] [1020101] Stop Reason FATAL_ERROR Error Level FATAL

我缺少什么配置来启用RDS PostgreSQL v11.8的CDC?我将DMS配置使用RDS主用户。如果删除slotName配置,则仅迁移现有数据 DMS 任务在此实例上成功。

相关的CloudWatch日志条目似乎是这些:

2021-02-03T22:03:05 [SOURCE_CAPTURE  ]I:  Slot has plugin 'test_decoding'  (postgres_test_decoding.c:233)
2021-02-03T22:03:05 [SOURCE_CAPTURE  ]I:  Initial positioning requested is 'now'  (postgres_endpoint_capture.c:511)
2021-02-03T22:03:05 [SOURCE_CAPTURE  ]E:  When working with Configured Slotname, user must specify LSN [1020101]  (postgres_endpoint_capture.c:517)
2021-02-03T22:03:05 [TASK_MANAGER    ]I:  Task - W6AUC5OI3DNFMFUQ6ZDEYYNZ3NBSABQK3HFD2WQ is in ERROR state, updating starting status to AR_NOT_APPLICABLE  (repository.c:5101)
2021-02-03T22:03:05 [TASK_MANAGER    ]E:  Task error notification received from subtask 0, thread 0 [1020101]  (replicationtask.c:2822)
2021-02-03T22:03:05 [TASK_MANAGER    ]E:  Error executing source loop; Stream component failed at subtask 0, component st_0_KVPUHIZBICJJRNGCC32HP5EFGGLIZLRF2YSRJ6Y ; Stream component 'st_0_KVPUHIZBICJJRNGCC32HP5EFGGLIZLRF2YSRJ6Y' terminated [1020101]  (replicationtask.c:2829)
2021-02-03T22:03:05 [TASK_MANAGER    ]E:  Task 'W6AUC5OI3DNFMFUQ6ZDEYYNZ3NBSABQK3HFD2WQ' encountered a fatal error  (repository.c:5194)
2021-02-03T22:03:05 [SORTER          ]I:  Final saved task state. Stream position , Source id 0, next Target id 1, confirmed Target id 0, last source timestamp 0  (sorter.c:803)

日志中的其他项目似乎是跟踪进度的信息。 [1]: (https://docs.aws.amazon.com/dms/latest/userguide/CHAP_Source.PostgreSQL.html#CHAP_Source.PostgreSQL.RDSPostgreSQL.CDC

profile picture
專家
已提問 8 個月前檢視次數 36 次
1 個回答
0

【以下的回答经过翻译处理】 请确认以下信息是否有助于解决问题,

rds.logical_replication 已启用。

如果使用现有槽位,则需要按照以下步骤对任务进行配置。 -->CLI -

aws dms create-replication-task --replication-task-identifier <<task_identifier>> --source-endpoint-arn <<SRC_ARN>> --target-endpoint-arn <<Target_ARN>> --replication-instance-arn <<RepInstance_ARN>> --migration-type cdc --table-mappings <<path_to_mapping_json>> --cdc-start-position "0/57D86A50" <<LSN 需要指定为起始位置>> --replication-task-settings <<Task_Setting_File>>

-->在 AWS DMS 中的源端点连接属性中添加槽位名称

如果不想使用现有的复制槽位,则 AWS DMS 会根据任务自动创建一个,我们不需要再创建。

使用以下命令进行验证

select * from pg_replication_slots;

更多参考信息 https://aws.amazon.com/premiumsupport/knowledge-center/dms-postgresql-fail-slots-in-use/ https://docs.aws.amazon.com/dms/latest/userguide/CHAP_Source.PostgreSQL.html#CHAP_Source.PostgreSQL.RDSPostgreSQL

profile picture
專家
已回答 8 個月前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南