我正在尝试以分布式模式运行Kafka工人。与独立模式不同,在以分布式模式启动工作线程时,我们无法传递连接器属性文件。在分布式模式下,工作程序是单独启动的,我们使用REST API在这些工作程序上部署和管理连接器
我尝试通过在curl命令中传递以下值来构建连接器并执行
curl -X POST -H "Content-Type: application/json" --data '{"name":"sailpointdb","connector.class":"io.confluent.connect.jdbc.JdbcSourceConnector","tasks.max":"1","connection.password " : " abc","connection.url " : "jdbc:mysql://localhost:3306/db","connection.user " : "abc" ,"query" : " SELECT * FROM (SELECT NAME, FROM_UNIXTIME(completed/1000) AS
TASKFAILEDON FROM abc WHERE COMPLETION_STATUS = 'Error') as A","mode" : " timestamp","timestamp.column.name" : "TASKFAILEDON","topic.prefix" : "dbevents","validate.non.null" : "false" }}' http://localhost:8089/connectors/
我遇到以下错误-卷曲:(3)使用错误/非法格式的URL或缺少URL
请让我知道以上curl声明出了什么问题,我在这里错过了什么吗?
答案 0 :(得分:1)
POST
到/connectors
,则需要name
和config
根级元素。但是,我建议使用PUT
/config
,因为如果需要您可以重新运行它以更新配置尝试一下:
curl -X PUT -H "Content-Type:application/json" \
http://localhost:8089/connectors/source-jdbc-sailpointdb-00/config \
-d '{
"connector.class": "io.confluent.connect.jdbc.JdbcSourceConnector",
"tasks.max": "1",
"connection.password ": " abc",
"connection.url ": "jdbc:mysql://localhost:3306/db",
"connection.user ": "abc",
"query": " SELECT * FROM (SELECT NAME, FROM_UNIXTIME(completed/1000) AS TASKFAILEDON FROM abc WHERE COMPLETION_STATUS = 'Error') as A",
"mode": " timestamp",
"timestamp.column.name": "TASKFAILEDON",
"topic.prefix": "dbevents",
"validate.non.null": "false"
}'