当我尝试使用kafka connect连接到mysql8.0时,我的驱动程序总是有一个问题。问题不是适合发现的驱动程序
这是针对新的Centos7plugin.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
mySQL驱动程序不用Kafka Connect JDBC连接器运送。您必须自己安装并在正确的位置安装。
您需要将相关的mysql jdbc驱动程序jar放在kafka Connect JDBC文件夹之前启动Kafka Connect Worker
这篇文章将为您提供更多详细信息。