创建无融合的Kafka连接

时间:2019-07-19 15:00:04

标签: windows apache-kafka-connect oracle-cdc

我最近开始使用Kafka,我尝试创建一个Kafka连接来连接到oracle,但是我做不到。我发现的有关融合的信息,但在Windows中不起作用...我如何配置一个或使用Java创建它?

我使用我的独立测试模式: cmd。\ windows \ connect-standalone.bat。\ config \ connect-standalone.properties。\ config \ connect-bbdd.properties->

name=jdbc-conector 
connector.class=io.confluent.connect.jdbc.JdbcSourceConnector 
tasks.max=1 
connection.url=dbc:oracle:thin@localhost:xe 
connection.user: user 
connection.password: pwd 
mode = bulk 
topic.prefix=test
table.whitelist: mytable

错误:

WARN The configuration 'offset.flush.interval.ms' was supplied but isn't a known config. (org.apache.kafka.clients.admin.AdminClientConfig)
WARN The configuration 'key.converter.schemas.enable' was supplied but isn't a known config. (org.apache.kafka.clients.admin.AdminClientConfig)
WARN The configuration 'offset.storage.file.filename' was supplied but isn't a known config. (org.apache.kafka.clients.admin.AdminClientConfig)
WARN The configuration 'value.converter.schemas.enable' was supplied but isn't a known config. (org.apache.kafka.clients.admin.AdminClientConfig)
 jul 21, 2019 10:36:13 PM org.glassfish.jersey.internal.Errors logErrors
ADVERTENCIA: The following warnings have been detected: WARNING: The (sub)resource method createConnector in 
org.apache.kafka.connect.runtime.rest.resources.ConnectorsResource contains empty path annotation.
WARNING: The (sub)resource method listConnectors in org.apache.kafka.connect.runtime.rest.resources.ConnectorsResource contains 
empty path annotation.
WARNING: The (sub)resource method listConnectorPlugins in org.apache.kafka.connect.runtime.rest.resources.ConnectorPluginsResource 
contains empty path annotation.
WARNING: The (sub)resource method serverInfo in org.apache.kafka.connect.runtime.rest.resources.RootResource contains empty path annotation.
[2019-07-21 22:36:13,886] ERROR Failed to create job for ..\config\connect-bbdd.properties (org.apache.kafka.connect.cli.ConnectStandalone)
[2019-07-21 22:36:13,888] ERROR Stopping after connector error (org.apache.kafka.connect.cli.ConnectStandalone)
Caused by: org.apache.kafka.connect.runtime.rest.errors.BadRequestException: Connector configuration 
is invalid and contains the following 2 error(s):
Invalid value java.sql.SQLException: No suitable driver found for jdbc:oracle:thin@localhost:xe 
for configuration Couldn't open connection to jdbc:oracle:thin@localhost:xe
You can also find the above list of errors at the endpoint `/{connectorType}/config/validate`
at org.apache.kafka.connect.util.ConvertingFutureCallback.result(ConvertingFutureCallback.java:79)
at org.apache.kafka.connect.util.ConvertingFutureCallback.get(ConvertingFutureCallback.java:66)
at org.apache.kafka.connect.cli.ConnectStandalone.main(ConnectStandalone.java:118)

...以及“任何类加载器(org.reflections.Reflections)”中的其他错误

2 个答案:

答案 0 :(得分:0)

confluent命令无法在Windows中本机运行,不能。

但是connect-distributedconnect-standalone不仅在Confluent中使用,而且如果您在Windows上下载了它们,那么它们应该都可以工作并加载Confluent Platform中提供的JDBC连接器。

否则,如果只有Apache Kafka,则需要download JDBC Connector separately并通过Connect配置文件中提到的plugin.path属性自行设置。

答案 1 :(得分:0)

您收到的此错误:

No suitable driver found for jdbc:oracle:thin@localhost:xe 
for configuration Couldn't open connection to jdbc:oracle:thin@localhost:xe

是因为您尚未使Oracle JDBC驱动程序可用。参见https://www.confluent.io/blog/kafka-connect-deep-dive-jdbc-source-connector#jdbc-drivers