Debezium PostgreSQL连接器配置无效问题求助
Debezium PostgreSQL 1.1连接器配置报错排查
核心错误原因:缺失必填参数database.server.name
Debezium 1.1版本的PostgreSQL连接器强制要求配置database.server.name,该参数用于唯一标识数据库服务器实例,是生成Kafka主题名称的核心组件,同时也是连接器区分不同数据源的关键标识。你的配置完全遗漏了该参数,这就是报错"A value is required"的直接原因。
额外配置优化点
- 移除重复配置:你同时配置了
table.include.list和table.whitelist,后者在Debezium 1.1中已被废弃,建议仅保留table.include.list。 - 修正curl命令引号问题:在Windows环境下,用双引号包裹JSON时,内部双引号需转义为
\",或改用单引号包裹(PowerShell支持),否则会导致JSON解析失败。 - 按需保留信号配置:
signal.kafka.bootstrap.servers仅在使用信号功能(如动态调整连接器配置)时需要,若未使用可暂时移除。
修正后的完整配置
{ "name": "sde-connector", "config": { "connector.class": "io.debezium.connector.postgresql.PostgresConnector", "database.hostname": "10.80.244.128", "database.port": "6432", "database.user": "postgres", "database.password": "123456", "database.dbname": "postgres", "database.server.name": "postgres_bank_server", "table.include.list": "bank.holding", "topic.prefix": "test_topic", "signal.kafka.bootstrap.servers": "kafka:9092" } }
修正后的curl命令(Windows PowerShell适用)
curl -i -X POST -H "Accept:application/json" -H "Content-Type:application/json" -d '{ "name": "sde-connector", "config": { "connector.class": "io.debezium.connector.postgresql.PostgresConnector", "database.hostname": "10.80.244.128", "database.port": "6432", "database.user": "postgres", "database.password": "123456", "database.dbname": "postgres", "database.server.name": "postgres_bank_server", "table.include.list": "bank.holding", "topic.prefix": "test_topic", "signal.kafka.bootstrap.servers": "kafka:9092" } }' localhost:8083/connectors
修正后的curl命令(Windows CMD适用)
curl -i -X POST -H "Accept:application/json" -H "Content-Type:application/json" -d "{ \"name\": \"sde-connector\", \"config\": { \"connector.class\": \"io.debezium.connector.postgresql.PostgresConnector\", \"database.hostname\": \"10.80.244.128\", \"database.port\": \"6432\", \"database.user\": \"postgres\", \"database.password\": \"123456\", \"database.dbname\": \"postgres\", \"database.server.name\": \"postgres_bank_server\", \"table.include.list\": \"bank.holding\", \"topic.prefix\": \"test_topic\", \"signal.kafka.bootstrap.servers\": \"kafka:9092\" } }" localhost:8083/connectors
内容的提问来源于stack exchange,提问作者Vlad Aleshin
相关产品推荐
相关产品推荐

