在尝试将融合器用于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`"
}
答案 0 :(得分:2)
消息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