我在MySQL database中有三个表
table1
table2
table3和Debezium MySQL连接器:
{
"name": "debezium_mysql_1",
"config": {
"connector.class": "io.debezium.connector.mysql.MySqlConnector",
"tasks.max": "1",
"database.hostname": "xxx.xxx.xxx",
"database.port": "3306",
"database.user": "debezium",
"database.password": "${file:/path/to/credentials:password}",
"database.server.name": "mysql",
"heartbeat.interval.ms": 5000,
"snapshot.mode": "when_needed",
"database.include.list": "database",
"table.include.list": "database.table1,database.table2,database.table3",
"database.history.kafka.topic": "database_history",
"database.history.kafka.recovery.poll.interval.ms": 5001,
"database.history.kafka.bootstrap.servers": "xxx.xxx.xxx:9092",
"database.serverTimezone": "Europe/Warsaw"
}
}三个表中的两个被加载到Kafka中,没有任何问题:
kafka-topics --list --zookeeper xxx.xxx:2181
mysql.database.table1
mysql.database.table3但是table2失踪了。
我已经为table2尝试了新的连接器--同样的。连接器为RUNNING,不登录集群,不创建新主题。
mysql中只有一个有趣的日志:
Aborted connection 8775 to db: 'unconnected' user: 'debezium' host: 'xxx.xxx.xxx' (failed on flush_net())table2与没有复制到Kafka的表1、3有什么不同?为什么连接器是RUNNING,并且没有日志?我可以做什么来“强制”连接器,以复制table2
发布于 2021-05-26 20:23:06
事实证明,缺少的表没有主键:
mysql> SHOW KEYS FROM table2 WHERE Key_name = 'PRIMARY';
Empty set (0.01 sec)我需要设置message.key.columns
https://stackoverflow.com/questions/67703772
复制相似问题