Kafka JDBC source connector

2019-12-16 19:20发布

I'm trying the JDBC source connector to get data from SQL Server.

I'm getting the error saying

ERROR Failed to create job for etc/kafka-connect-jdbc/source-quickstart-sqlserver.properties

My properties file look like below. What am I missing?

name=test-sqlserver-jdbc-autoincrement
connector.class=io.confluent.connect.jdbc.JdbcSourceConnector
tasks.max=1
connection.url=jdbc:sqlserver://******:1433;databaseName=****;user=****l;password=****
table.whitelist=****
mode=incrementing
incrementing.column.name=id
topic.prefix=test-sqlserver-jdbc-

Also if I try to get the error details using curl http://localhost:8083 /JdbcSourceConnector/config/validate, I get error url malformed which I believe is a bug in kafka 10.2.0

2条回答
对你真心纯属浪费
2楼-- · 2019-12-16 19:57

Try with below properties file.

name=test-mysql-jdbc-autoincrement
connector.class=io.confluent.connect.jdbc.JdbcSourceConnector
tasks.max=1
connection.url=jdbc:mysql://localhost:3306/training?user=admin&password=password@538&useSSL=false

query=select emp.emp_dept_id, emp.timestamp, emp.emp_name, dept.dept_name from kafka_employee emp join kafka_department dept on emp.emp_dept_id = dept.dept_id
mode=timestamp+incrementing

incrementing.column.name=emp_dept_id
timestamp.column.name=timestamp

topic.prefix=test-mysql-jdbc-kp
poll.interval.ms = 1000
查看更多
beautiful°
3楼-- · 2019-12-16 20:13

if you are on an experimental environment try the following.

connection.url=jdbc:mysql://127.0.0.1:3306/my_db
connection.user=user
connection.password=pass
useSSL=false

also make sure that the incrementing column name is correct and that it is auto-increment.

查看更多
登录 后发表回答