重置 JDBC Kafka 连接器以从一开始就开始拉行?

Reset the JDBC Kafka Connector to start pulling rows from the beginning of time?(重置 JDBC Kafka 连接器以从一开始就开始拉行?)
本文介绍了重置 JDBC Kafka 连接器以从一开始就开始拉行?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

问题描述

Kafka 连接器可以使用主键和时间戳来确定需要处理哪些行.

The Kafka Connector can make use of a primary key and a timestamp to determine which rows need to be processed.

我正在寻找一种重置连接器的方法,以便它从一开始就进行处理.

I'm looking for a way to reset the Connector so that it will process from the beginning of time.

推荐答案

因为要求是在分布式模式下运行,所以最简单的做法是将连接器名称更新为新值.这将提示在 connect-offsets 主题中创建一个新条目,因为它看起来像一个全新的连接器.然后连接器应该再次开始读取,好像还没有向 Kafka 写入任何内容.您还可以手动向与该特定连接器关联的连接偏移主题中的键发送墓碑消息,但重命名比处理它容易得多.此方法适用于所有源连接器,而不仅仅是此处描述的 JDBC 连接器.

Because the requirement is to run in distributed mode, the easiest thing to do is to update the connector name to a new value. This will prompt a new entry to be made into the connect-offsets topic as it looks like a totally new connector. Then the connector should start reading again as if nothing has been written to Kafka yet. You could also manually send a tombstone message to the key in the connect-offsets topic associated with that particular connector, but renaming is much easier than dealing with that. This method applies to all source connectors, not only the JDBC one described here.

这篇关于重置 JDBC Kafka 连接器以从一开始就开始拉行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

相关文档推荐

Does SQL Server Offer Anything Like MySQL#39;s ON DUPLICATE KEY UPDATE(SQL Server 是否提供类似于 MySQL 的 ON DUPLICATE KEY UPDATE 之类的东西)
Storing JSON in database vs. having a new column for each key(将 JSON 存储在数据库中与为每个键创建一个新列)
How to export SQL Server database to MySQL?(如何将 SQL Server 数据库导出到 MySQL?)
Emulate MySQL LIMIT clause in Microsoft SQL Server 2000(在 Microsoft SQL Server 2000 中模拟 MySQL LIMIT 子句)
SQL: Repeat a result row multiple times, and number the rows(SQL:多次重复结果行,并对行进行编号)
MySQL LIMIT clause equivalent for SQL SERVER(与 SQL SERVER 等效的 MySQL LIMIT 子句)