Kafka 连接器 - 独立模式

Kafka connectors - Standalone mode

我运行宁文件连接器处于独立模式。我在连接 运行ning 时更新了接收器连接属性文件。除非我重新启动连接,否则不会反映更改,例如

> bin/connect-standalone.sh config/connect-standalone.properties
> config/connect-file-source.properties
> config/connect-file-sink.properties

是否可以更新连接属性 运行 时间而无需再次重新启动连接

不,这在独立模式下是不可能的。这是使用分布式模式的另一个很好的理由,在这种模式下,您可以在工作人员 运行 使用 REST 接口时添加、更新和删除配置。要创建或更新连接器,您将使用 PUT:

curl -i -X PUT -H  "Content-Type:application/json" http://localhost:8083/connectors/source-file-01/config \
    -d '{
    "connector.class": "org.apache.kafka.connect.file.FileStreamSourceConnector",
    "tasks.max": "1",
    "file": "/usr/share/details.txt",
    "topic": "KTest",
    "key.converter": "org.apache.kafka.connect.storage.StringConverter",
    "value.converter": "org.apache.kafka.connect.storage.StringConverter",
    "name": "file_source"
}'

要删除它,您可以使用

curl -i -X DELETE -H  "Content-Type:application/json" http://localhost:8083/connectors/source-file-01