【问题标题】:Issue with Confluent JDBC Source connectorConfluent JDBC 源连接器的问题
【发布时间】:2019-06-11 00:28:02
【问题描述】:

我在尝试将 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`"
}

【问题讨论】:

  • 您是否进行了以下步骤: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.?
  • 是的,但我仍然遇到同样的问题。我有 mysql-connector-java-5.1.47.jar。
  • 好吧,也许我需要在放置 jar 后重新启动 kafka-connect。现在起来了。谢谢!
  • 是的,您需要在使新的 JAR 可用后重新启动 Kafka Connect

标签: mysql jdbc apache-kafka-connect confluent-platform


【解决方案1】:

消息No suitable driver found for表示找不到合适的jdbc驱动。

根据文章修复上述错误,您需要在share/java/kafka-connect-jdbc 中放置适当的 jdbc 驱动程序

要使用 JDBC 连接器,您需要为您的源数据库提供相关的 JDBC 驱动程序。该连接器附带 PostgreSQL 和 sqlite 的驱动程序——所有其他人下载适当的 JAR 并将其放在 share/java/kafka-connect-jdbc 中。您可以在此处找到 MySQL、Oracle、SQL Server、DB2 和 Teradata 的相关下载。

复制jar后需要重启Kafka Connect

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2021-08-30
    • 2018-10-25
    • 2018-09-14
    • 2018-10-01
    • 1970-01-01
    • 2020-02-05
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多