当我尝试使用kafka connect连接到mysql8.0时,总是存在有关我的驱动程序的问题。 问题是找不到合适的驱动程序
这是用于新的CentOS7 plugin.path = [share / java,/ root / confluent-5.2.1 / share / confluent-hub-components] 在/root/confluent-5.2.1/share/confluent-hub-components目录下, 有拖车司机:
[root@localhost confluent-hub-components]# ls
confluentinc-kafka-connect-jdbc debezium-debezium-connector-mysql
我的司机是
[root@localhost confluent-hub-components]# cd confluentinc-kafka-connect-jdbc/
[root@localhost confluentinc-kafka-connect-jdbc]# ls
assets doc etc lib manifest.json
[root@localhost confluentinc-kafka-connect-jdbc]# cd lib
[root@localhost lib]# ls
audience-annotations-0.5.0.jar jline-0.9.94.jar kafka-connect-jdbc-5.2.1.jar postgresql-9.4-1206-jdbc41.jar sqlite-jdbc-3.25.2.jar zookeeper-3.4.13.jar
common-utils-5.2.1.jar jtds-1.3.1.jar netty-3.10.6.Final.jar slf4j-api-1.7.25.jar zkclient-0.10.jar
这是我的代码
bin/connect-standalone etc/schema-registry/connect-avro-standalone.properties etc/kafka-connect-jdbc/mysql-source.properties
mysql-source.properties:
#tasks to create:
name=jdbc-source-mysql-01
connector.class=io.confluent.connect.jdbc.JdbcSourceConnector
#tasks.max=1
# a table called 'users' will be written to the topic 'test-mysql-jdbc-users'.
connection.user=root
connection.password=root
connection.url=jdbc:mysql://localhost:3306/employees
mode=bulk
#incrementing.column.name=fdsid
topic.prefix=test-mysql-jdbc-
错误:
Invalid value java.sql.SQLException: No suitable driver found for jdbc:mysql://localhost:3306/employees for configuration Couldn't open connection to jdbc:mysql://localhost:3306/employees
答案 0 :(得分:0)
Kafka Connect JDBC连接器未附带MySQL驱动程序。您必须自己安装并安装在正确的位置。
在启动Kafka Connect工作程序之前,您需要将相关的MySQL JDBC驱动程序JAR放入Kafka Connect JDBC文件夹
This post将为您提供更多详细信息。