在版本0.9中工作的kafka连接作业在版本0.10.2中不工作

9o685dep  于 2021-06-07  发布在  Kafka
关注(0)|答案(1)|浏览(449)

当我运行我的Kafka连接作业时,我得到下面的错误

[2017-04-25 14:56:22,806] ERROR Failed to create job for ./etc/kafka-connect-jdbc/sqlserver.properties (org.apache.kafka.connect.cli.ConnectStandalone:88)
[2017-04-25 14:56:22,808] ERROR Stopping after connector error (org.apache.kafka.connect.cli.ConnectStandalone:99)
java.util.concurrent.ExecutionException: org.apache.kafka.connect.runtime.rest.errors.BadRequestException: Connector configuration is invalid (use the endpoint `/{connectorType}/config/validate` to get a full list of errors)
    at org.apache.kafka.connect.util.ConvertingFutureCallback.result(ConvertingFutureCallback.java:80)
    at org.apache.kafka.connect.util.ConvertingFutureCallback.get(ConvertingFutureCallback.java:67)
    at org.apache.kafka.connect.cli.ConnectStandalone.main(ConnectStandalone.java:96)
Caused by: org.apache.kafka.connect.runtime.rest.errors.BadRequestException: 
Connector configuration is invalid (use the endpoint `/{connectorType}/config/validate` to get a full list of errors)
    at org.apache.kafka.connect.runtime.standalone.StandaloneHerder.putConnectorConfig(StandaloneHerder.java:161)
    at org.apache.kafka.connect.cli.ConnectStandalone.main(ConnectStandalone.java:93)

我的属性文件是

name=test-sqlserver-jdbc-autoincrement
connector.class=io.confluent.connect.jdbc.JdbcSourceConnector
tasks.max=1
connection.url=jdbc:sqlserver://192.168.9.142:1433;databaseName=postilion;user=elasticsearch;password=elasticsearch
query=select convert(varchar(10), date_time, 120) as date,convert(char(12), 
date_time, 114) as time, * from support_notifications
mode=timestamp+incrementing
timestamp.column.name=date_time
incrementing.column.name=event_nr
topic.prefix=test-events

我试着用get调用kafka connect(在它崩溃之前) curl http://localhost:8083 /JdbcSourceConnector/config/validate 我得到了回应 {"version":"0.10.2.0-cp1","commit":"64c9b42f3319cdc9"}curl: (3) <url> malformed . 你知道我做错了什么吗,因为这项工作在Kafka0.9里起了作用。

0ejtzxu1

0ejtzxu11#

所以我找到了出路。最后,我在属性文件中将模式从timestamp+incrementing改为incrementing,并删除了timestamp.column.name=date\u time行。属性文件现在如下所示

name=test-sqlserver-jdbc-autoincrement
connector.class=io.confluent.connect.jdbc.JdbcSourceConnector
tasks.max=1
connection.url=jdbc:sqlserver://192.168.9.142:1433;databaseName=postilion;user=elasticsearch;password=elasticsearch
query=select convert(varchar(10), date_time, 120) as date,convert(char(12), date_time, 114) as time, * from support_notifications
mode=incrementing
incrementing.column.name=event_nr
topic.prefix=postilion-events

相关问题