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

时间:2017-04-25 22:16:09

标签: sql-server apache-kafka apache-kafka-connect confluent data-ingestion

当我运行我的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

我尝试使用curl http://localhost:8083 /JdbcSourceConnector/config/validate对kafka connect(崩溃之前)进行 GET 调用,我得到了响应{"version":"0.10.2.0-cp1","commit":"64c9b42f3319cdc9"}curl: (3) <url> malformed。任何想法,因为这项工作在kafka 0.9中有效,我做错了。

1 个答案:

答案 0 :(得分:0)

所以我找到了出路。我最终在属性文件中将模式时间戳+递增更改为递增,并删除了行 timestamp.column.name = DATE_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