我正在尝试使用 Debezium 设置从 PostgreSQL 数据库到 Kafka 的变更数据捕获 (CDC)。我已成功从 MySQL 数据库为 CDC 配置 Debezium,但在尝试连接到 PostgreSQL 数据库时遇到问题。
以下是我迄今为止采取的步骤:
安装并配置了 Kafka 和 Debezium。
已验证 PostgreSQL 数据库已将 wal_level 设置为逻辑。
用户权限
使用适当的设置配置 Debezium PostgreSQL 连接器。
{
"name": "postgres-connector",
"config": {
"connector.class": "io.debezium.connector.postgresql.PostgresConnector",
"tasks.max": "1",
"database.hostname": "localhost",
"database.port": "5432",
"database.user": "myadmin",
"database.password": "123",
"database.dbname": "source_db",
"database.server.name": "etltask",
"table.include.list": "source_db.source_table",
"database.history.kafka.bootstrap.servers": "localhost:9092",
"database.history.kafka.topic": "schema-changes.source_db",
"topic.prefix": "etltask"
}
}
但是,当尝试启动 Debezium 连接器任务时,我遇到以下错误。如何解决此错误并使用 debezium 设置从 postgres 到 Kafka 的 CDC?
通常这意味着
debezium
用户在数据库中没有适当的权限。看一下:https://debezium.io/documentation/reference/stable/connectors/postgresql.html#postgresql-permissions