当我运行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
进行 get 调用kafka connect(崩溃之前(,并且我得到了响应 {"version":"0.10.2.0-cp1","commit":"64c9b42f3319cdc9"}curl: (3) <url> malformed
。当这项工作在kafka 0.9工作时,我做错了什么。
,所以我找到了出路。我最终从 timestamp 递增更改模式在属性文件中递增,然后删除了行 timestamp.column.name.name.name.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