我最近开始使用Kafka,我尝试创建一个Kafka连接来连接到oracle,但我做不到。我找到的信息是关于 confluent 的,但这在 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 ..configconnect-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("的其他错误
confluent
命令在Windows中不起作用,不。
但是connect-distributed
或connect-standalone
不仅在Confluent中,并且如果您确实在Windows上下载了Confluent,则应该可以工作和加载Confluent平台中提供的JDBC连接器。
否则,如果您只有 Apache Kafka,则需要单独下载 JDBC 连接器,并通过 Connect 配置文件中提到的 plugin.path
属性自行设置。
您得到的此错误:
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。