如何删除 debezium 连接器
Posted
技术标签:
【中文标题】如何删除 debezium 连接器【英文标题】:How to delete a debezium connector 【发布时间】:2021-09-07 07:34:21 【问题描述】:。我正在关注本教程 https://debezium.io/documentation/reference/tutorial.html 我看到了注册连接器的方法,但不知道如何删除/更新连接器。
curl -i -X POST -H "Accept:application/json" -H "Content-Type:application/json" localhost:8083/connectors/ -d ' "name": "inventory-connector", "config": "connector.class": "io.debezium.connector.mysql.MySqlConnector", "tasks.max": "1", "database.hostname": "mysql", "database.port": "3306", "database.user": "debezium", "database.password": "dbz", "database.server.id": "184054", "database.server.name": "dbserver1", "database.include.list": "inventory", "database.history.kafka.bootstrap.servers": "kafka:9092", "database.history.kafka.topic": "dbhistory.inventory" '
您能否也请指向我提到删除和更新连接器的文档页面。
【问题讨论】:
【参考方案1】:debezium connector
是一个标准的连接器,可以插入到 kafka connet 框架中。 Kafka Connect 框架支持多个 REST 命令以便与之交互。
要删除,请提交 DELETE 请求
curl -i -X DELETE localhost:8083/connectors/inventory-connector/
要更新配置,请使用新配置提交 PUT 请求
curl -i -X PUT -H "Accept:application/json" -H "Content-Type:application/json" localhost:8083/connectors/inventory-connector/config -d ' "connector.class": "io.debezium.connector.mysql.MySqlConnector", "tasks.max": "1", "database.hostname": "mysql", "database.port": "3306", "database.user": "debezium", "database.password": "dbz", "database.server.id": "184054", "database.server.name": "dbserver1", "database.include.list": "inventory", "database.history.kafka.bootstrap.servers": "kafka:9092", "database.history.kafka.topic": "dbhistory.inventory" '
更多 REST API 说明
https://docs.confluent.io/platform/current/connect/references/restapi.html
【讨论】:
删除连接器时,无法重新创建同名的debezium。 @prakashpoudel 我认为这是因为删除连接器不会删除复制槽(在 Postgres 中),并且您不能有 2 个具有相同名称的槽。以上是关于如何删除 debezium 连接器的主要内容,如果未能解决你的问题,请参考以下文章
有没有办法删除debezium mysql连接器的现有任务并用新任务替换它