【问题标题】:Configuring Kafka connect Postgress Debezium CDC plugin配置 Kafka 连接 Postgress Debezium CDC 插件
【发布时间】:2019-09-02 15:17:35
【问题描述】:

我正在尝试使用 kafka connect 来读取 postgress 数据库中的更改。 我在本地系统上运行 Kafka,我想在独立模式下使用 Kafka 连接 API 来读取 postgress 服务器数据库更改。

connect-standalone.sh connect-standalone.properties dbezium.properties

如果有人可以帮助我为 CDC postgress debezium 连接器设置配置属性,我将不胜感激

https://www.confluent.io/connector/debezium-postgresql-cdc-connector/

我按照下面的方法来构造属性

https://debezium.io/docs/connectors/postgresql/#how-the-postgresql-connector-works

Kafka 主题的名称默认采用以下形式 serverName.schemaName.tableName,其中 serverName 是逻辑名称 使用 database.server.name 指定的连接器的 配置属性

这是我为 dbezium.properties 提出的建议

name=cdc_demo
connector.class=io.debezium.connector.postgresql.PostgresConnector
tasks.max=1
plugin.name=wal2json
slot.name=debezium
slot.drop_on_stop=false
database.hostname=localhost
database.port=5432
database.user=postgress
database.password=postgress
database.dbname=test
time.precision.mode=adaptive
database.sslmode=disable

假设我创建了一个 PG 模式名称作为演示,表名作为供应商

所以我需要创建一个名为 test.demo.suppliers 的主题,以便这个插件可以将数据推送到?

还有人可以推荐一个 docker 镜像,它有 postgress 服务器 + 合适的复制插件,如 wal2json 等?我自己很难配置 postgress 和 CDC 插件。

【问题讨论】:

    标签: postgresql apache-kafka-connect debezium


    【解决方案1】:

    查看the tutorial 与关联的Docker Composesample config

    您提出的主题听起来是正确的,但如果您将 Kafka 代理配置为自动创建主题(这是 IIRC 的默认行为),那么它将为您创建,您无需预先-创造它。

    【讨论】:

      猜你喜欢
      • 2023-01-06
      • 1970-01-01
      • 2020-07-09
      • 2020-04-20
      • 2019-02-16
      • 2019-10-20
      • 2019-01-17
      • 2019-07-22
      • 2019-11-21
      相关资源
      最近更新 更多