mysql - 删除“table.include.list”不会强制 Debezium 为数据库中的其余表创建主题
问题描述
我创建了 Debezium 连接器,它就像一个魅力:
{
"name": "debezium_title",
"config": {
"connector.class": "io.debezium.connector.mysql.MySqlConnector",
"tasks.max": "1",
"database.hostname": "xxx.xxx.xxx",
"database.port": "3306",
"database.user": "kafkaconnect",
"database.password": "***",
"database.server.name": "mysql_debezium",
"heartbeat.interval.ms": 5000,
"snapshot.mode": "when_needed",
"snapshot.new.tables": "parallel",
"database.include.list": "database",
"table.include.list": "database.table1,database.table2",
"database.history.kafka.topic": "mysql_debezium_history",
"database.history.kafka.recovery.poll.interval.ms": 5000,
"database.history.kafka.bootstrap.servers": "xxx.xxx.xxx:9092",
"include.schema.changes": "false",
"transforms": "extractInt",
"transforms.extractInt.type": "org.apache.kafka.connect.transforms.ExtractField$Key",
"transforms.extractInt.field": "id"
}
}
现在,我想删除此连接器并创建一个没有表白名单的新连接器 - 以摄取整个数据库:
{
"name": "debezium_title_new",
"config": {
"connector.class": "io.debezium.connector.mysql.MySqlConnector",
"tasks.max": "1",
"database.hostname": "xxx.xxx.xxx",
"database.port": "3306",
"database.user": "kafkaconnect",
"database.password": "***",
"database.server.name": "mysql_debezium_new",
"heartbeat.interval.ms": 5000,
"snapshot.mode": "initial",
"database.include.list": "database",
"database.history.kafka.topic": "debezium_mysql_history_new",
"database.history.kafka.recovery.poll.interval.ms": 5000,
"database.history.kafka.bootstrap.servers": "xxx.xxx.xxx:9092"
}
}
带有新的:连接器名称、数据库服务器名称和数据库历史 kafka 主题名称。
奇怪的是,它只为我"table.include.list"
为第一个连接器设置的表格创建了主题!
kafka-topics --list --zookeeper xxx.xxx:2181
mysql_debezium_new.table1
mysql_debezium_new.table2
一段时间后发生错误:
Encountered change event for table database.table3 whose schema isn't known to this connector
(table3 是数据库中表的示例,它不在第一个连接器的白名单中)
我的数据库中的其余表在哪里?:) 当我已经拥有带有表白名单的连接器时,如何强制 Debezium 从 mysql 中移动所有表(删除第一个连接器并创建没有白名单的新连接器无济于事)。
我也尝试将新表添加到白名单,但它也不起作用 - 它不会创建新主题并且不会加载整个表 - 它等待表中的第一条新记录,然后发生错误:架构不是知道这张桌子。
那个怎么样?Debezium 是否为第一个连接器拍摄数据库快照,然后将其保存在某个地方并保留它?我怎样才能重置它?
Debezium 版本:1.5
解决方案
该参数是可选的,如果您希望它获取所有非系统表,则完全忽略该参数。
来自文档: 可选的以逗号分隔的正则表达式列表,与您希望 Debezium 捕获的表的完全限定表标识符匹配;未包含在 table.include.list 中的任何表都将从捕获中排除。每个标识符的格式为 schemaName.tableName。默认情况下,连接器会捕获指定模式的所有非系统表。不得与 table.exclude.list 一起使用。
链接到上述 Debezium 文档:https ://debezium.io/documentation/reference/connectors/sqlserver.html
推荐阅读
- android - 如何解码有效载荷并获取 JWT 有效载荷中的值
- django - 如果数据库中存在数据,则禁用表单字段
- python - 如何下载包含交互式条形图数据但没有 URL,只有 XPath 的文本文件?硒是一种有效的解决方案吗?
- python - 使用node js中的pythonshell包将python脚本连接到node js
- java - 实用函数对 Array 类的正确签名:Comparable
或可比? - php - docker 组合多个项目
- javascript - Brain.js 人工神经网络预测缺失变量值
- python - 如何提取numpy数组的一部分?
- hadoop - Hive cli 启动引发错误无法识别的 Hadoop 主要版本号:1.0.4
- python - 如何过滤输出结果并设置范围?