JDBC Kafka Connector是否可以从多个数据库中提取数据? [英] Can the JDBC Kafka Connector pull data from multiple databases?

查看:79
本文介绍了JDBC Kafka Connector是否可以从多个数据库中提取数据?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我很想设置一个JDBC Kafka连接器集群,并将它们配置为从同一主机上运行的多个数据库中提取.

I would love to setup a cluster of JDBC Kafka Connectors and configure them to pull from multiple databases running on the same host.

我一直在浏览Kafka Connect文档,看来在配置JDBC连接器后,它只能从单个数据库中提取数据.

I've been looking through the Kafka Connect documentation, and it appears that after you configure the JDBC connector that it can only pull data from a single database.

任何人都可以确认吗?

推荐答案

根据启动工作程序的方式(独立或分布式):

Depending on the mode you start your workers (standalone or distributed) :

在独立模式下,您可以使用以下命令启动多个jdbc连接器:

In the standalone mode, you can start multiple jdbc connectors by using :

bin/connect-standalone worker.properties connector1.properties [connector2.properties connector3.properties ...]

每个connector.properties与一个数据库匹配的地方.

Where each connector.properties match one database.

此处有更多详细信息:在职工人

More details here : Running workers

在分布式模式下,首先使用:

 bin/connect-distributed worker.properties

然后使用POST http请求推送每个配置,例如:

Then push each configuration with POST http requests like :

$ curl -X POST -H "Content-Type: application/json" --data '{"name": "jdbc-source", "config": {"connector.class":"JdbcSourceConnector", "tasks.max":"1", "connection.url":"jdbc:sqlite:test.db", "topic.prefix":"connect-jdbc-test-", "mode":"bulk" }}' http://worker_host:8083/connectors

或者,要使用包含JSON格式配置的文件

Or, to use a file containing the JSON-formatted configuration

$ curl -X POST -H "Content-Type: application/json" --data @config.json http://worker_host:8083/connectors

这篇关于JDBC Kafka Connector是否可以从多个数据库中提取数据?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆