当我创建kafka jdbc源连接器(debezium connector for oracle with confluent-5.4.0)时,得到错误“找不到适合的驱动程序”jdbc:oracle:oci。
[2020-03-23 11:49:44,521] ERROR WorkerSourceTask{id=debezium-souce-inventory-0} Task threw an uncaught and unrecoverable exception (org.apache.kafka.connect.runtime.WorkerTask:179)
org.apache.kafka.connect.errors.ConnectException: An exception ocurred in the change event producer. This connector will be stopped.
at io.debezium.connector.base.ChangeEventQueue.throwProducerFailureIfPresent(ChangeEventQueue.java:170)
at io.debezium.connector.base.ChangeEventQueue.poll(ChangeEventQueue.java:151)
at io.debezium.connector.oracle.OracleConnectorTask.poll(OracleConnectorTask.java:110)
at org.apache.kafka.connect.runtime.WorkerSourceTask.poll(WorkerSourceTask.java:265)
at org.apache.kafka.connect.runtime.WorkerSourceTask.execute(WorkerSourceTask.java:232)
at org.apache.kafka.connect.runtime.WorkerTask.doRun(WorkerTask.java:177)
at org.apache.kafka.connect.runtime.WorkerTask.run(WorkerTask.java:227)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.RuntimeException: java.sql.SQLException: No suitable driver found for jdbc:oracle:oci:@test:1521/testdb
at io.debezium.relational.RelationalSnapshotChangeEventSource.execute(RelationalSnapshotChangeEventSource.java:179)
at io.debezium.pipeline.ChangeEventSourceCoordinator.lambda$start$0(ChangeEventSourceCoordinator.java:83)
... 5 more
Caused by: java.sql.SQLException: No suitable driver found for jdbc:oracle:oci:@test:1521/testdb
at java.sql.DriverManager.getConnection(DriverManager.java:689)
at java.sql.DriverManager.getConnection(DriverManager.java:247)
at io.debezium.connector.oracle.OracleConnectionFactory.connect(OracleConnectionFactory.java:25)
at io.debezium.jdbc.JdbcConnection.connection(JdbcConnection.java:756)
at io.debezium.jdbc.JdbcConnection.connection(JdbcConnection.java:751)
at io.debezium.relational.RelationalSnapshotChangeEventSource.execute(RelationalSnapshotChangeEventSource.java:119)
... 6 more
[2020-03-23 11:49:44,521] ERROR WorkerSourceTask{id=debezium-souce-inventory-0} Task is being killed and will not recover until manually restarted (org.apache.kafka.connect.runtime.WorkerTask:180)
我的oracle版本是enterprise edition release 11.2.0.4.0-64位产品,我尝试了不同的驱动程序jar,但得到了相同的异常。
我的jdk版本是:
[root@vtsz-big-dwh02 /]# echo $JAVA_HOME
/usr/java/jdk1.8.0_191
我已经将debezium connector oracle添加到文件夹confluent-5.4.0/share/java中。
正如debezium文档所说,我安装instant client并将文件ojbc8.jar和xtreams.jar从instant client复制到kafka的libs中
直接( confluent-5.4.0/share/java/kafka
, confluent-5.4.0/share/java/kafka-connect-jdbc ,
/opt/汇合-5.4.0/lib ,
/usr/share/java`)。
[root@vtsz-big-dwh02 java]# echo $LD_LIBRARY_PATH
/home/app/instantclient_11_2/:
我的源连接器配置是:
{
"name": "debezium-souce-idea-inventory",
"config": {
"connector.class": "io.debezium.connector.oracle.OracleConnector",
"tasks.max": "1",
"database.server.name":"testdb",
"database.out.server.name":"testdb",
"database.hostname": "10.0.10.169",
"database.port": "1521",
"database.user": "mytest",
"database.password": "mytest",
"database.dbname" : "testdb",
"table.whitelist": "ideas.WMS_INVENTORY",
"database.history.kafka.bootstrap.servers":"localhost:9092",
"database.history.kafka.topic":"schema-changes.inventory"
}
}
1条答案
按热度按时间bvpmtnay1#
您需要将连接器(在本例中是debezium)所依赖的jar文件与连接器插件放在同一文件夹(或子文件夹)中。
所以不是把它们放进去
把它们放进去
(或者实际debezium jar插件所在的位置)