Confluent JDBC 源连接器问题

Issue with Confluent JDBC Source connector

我在尝试将 confluent 用于 kafka-connect 时遇到以下问题。我正在尝试按照 https://www.confluent.io/blog/simplest-useful-kafka-connect-data-pipeline-world-thereabouts-part-1/

上给出的演示进行操作

错误:

./bin/confluent load jdbc_source_mysql_foobar_01 -d /tmp/kafka-connect-jdbc-source.json
{
This CLI is intended for development only, not for production
https://docs.confluent.io/current/cli/index.html

{
  "error_code": 400,
  "message": "Connector configuration is invalid and contains the following 2 error(s):\nInvalid value java.sql.SQLException: No suitable driver found for jdbc:mysql://localhost:3306/demo?user=root&password=tiger for configuration Couldn't open connection to jdbc:mysql://localhost:3306/demo?user=root&password=tiger\nInvalid value java.sql.SQLException: No suitable driver found for jdbc:mysql://localhost:3306/demo?user=root&password=tiger for configuration Couldn't open connection to jdbc:mysql://localhost:3306/demo?user=root&password=tiger\nYou can also find the above list of errors at the endpoint `/{connectorType}/config/validate`"
}

消息 No suitable driver found for 表示找不到正确的 jdbc 驱动程序。

根据修复上述错误的文章,您需要在 share/java/kafka-connect-jdbc

中放置适当的 jdbc 驱动程序

To use the JDBC connector, you’ll need to make available the relevant JDBC driver for your source database. The connector ships with drivers for PostgreSQL and sqlite—for all others download the appropriate JAR and place it in share/java/kafka-connect-jdbc. You can find the relevant downloads here for MySQL, Oracle, SQL Server, DB2, and Teradata.

复制完jar后,需要重启Kafka Connect