简体   繁体   English

Kafka connect 2.0.0 - 无法在集群模式下创建连接器 - 错误:请求领导重新配置连接器任务失败

[英]Kafka connect 2.0.0 - unable to create connectors in cluster mode - Error: Request to leader to reconfigure connector tasks failed

I have deployed Kafka connect (2.0.0) cluster across 2 nodes which is part of Hortonworks Data Platform 3.1.4.我已经跨 2 个节点部署了 Kafka connect (2.0.0) 集群,这是 Hortonworks Data Platform 3.1.4 的一部分。 It gets deployed successfully and the kafka connect starts too.它已成功部署,并且 kafka 连接也开始。 I am able to use REST commands to list the connectors using GET method.我能够使用 REST 命令使用 GET 方法列出连接器。

Problem is, when I am trying to create the connector using POST method in cluster mode, it fails to create the connector or if it does create the connector then it fails to create the task.问题是,当我尝试在集群模式下使用 POST 方法创建连接器时,它无法创建连接器,或者如果它确实创建了连接器,则它无法创建任务。 I see the following error in logs我在日志中看到以下错误

    [2020-02-14 15:45:41,622] ERROR [pool-3-thread-1] [org.apache.kafka.connect.runtime.distributed.DistributedHerder] - Request to leader to reconfigure connector tasks failed
org.apache.kafka.connect.runtime.rest.errors.ConnectRestException: Failed to start RestClient: org.eclipse.jetty.io.ManagedSelector@78075cca id=0 keys=0 selected=0
        at org.apache.kafka.connect.runtime.rest.RestClient.httpRequest(RestClient.java:74)
        at org.apache.kafka.connect.runtime.distributed.DistributedHerder$18.run(DistributedHerder.java:1034)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at java.lang.Thread.run(Thread.java:748)
Caused by: java.util.concurrent.RejectedExecutionException: org.eclipse.jetty.io.ManagedSelector@78075cca id=0 keys=0 selected=0
        at org.eclipse.jetty.util.thread.QueuedThreadPool.execute(QueuedThreadPool.java:383)
        at org.eclipse.jetty.io.SelectorManager.execute(SelectorManager.java:143)
        at org.eclipse.jetty.io.ManagedSelector.doStart(ManagedSelector.java:91)
        at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
        at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:131)
        at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:113)
        at org.eclipse.jetty.io.SelectorManager.doStart(SelectorManager.java:273)
        at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
        at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:131)
        at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:113)
        at org.eclipse.jetty.client.AbstractConnectorHttpClientTransport.doStart(AbstractConnectorHttpClientTransport.java:64)
        at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
        at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:131)
        at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:113)
        at org.eclipse.jetty.client.HttpClient.doStart(HttpClient.java:244)
        at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
        at org.apache.kafka.connect.runtime.rest.RestClient.httpRequest(RestClient.java:71)
        ... 6 more
[2020-02-14 15:45:41,622] ERROR [pool-3-thread-1] [org.apache.kafka.connect.runtime.distributed.DistributedHerder] - Failed to reconfigure connector's tasks, retrying after backoff:
org.apache.kafka.connect.runtime.rest.errors.ConnectRestException: Failed to start RestClient: org.eclipse.jetty.io.ManagedSelector@78075cca id=0 keys=0 selected=0
        at org.apache.kafka.connect.runtime.rest.RestClient.httpRequest(RestClient.java:74)
        at org.apache.kafka.connect.runtime.distributed.DistributedHerder$18.run(DistributedHerder.java:1034)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at java.lang.Thread.run(Thread.java:748)
Caused by: java.util.concurrent.RejectedExecutionException: org.eclipse.jetty.io.ManagedSelector@78075cca id=0 keys=0 selected=0
        at org.eclipse.jetty.util.thread.QueuedThreadPool.execute(QueuedThreadPool.java:383)
        at org.eclipse.jetty.io.SelectorManager.execute(SelectorManager.java:143)
        at org.eclipse.jetty.io.ManagedSelector.doStart(ManagedSelector.java:91)
        at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
        at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:131)
        at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:113)
        at org.eclipse.jetty.io.SelectorManager.doStart(SelectorManager.java:273)
        at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
        at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:131)
        at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:113)
        at org.eclipse.jetty.client.AbstractConnectorHttpClientTransport.doStart(AbstractConnectorHttpClientTransport.java:64)
        at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
        at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:131)
        at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:113)
        at org.eclipse.jetty.client.HttpClient.doStart(HttpClient.java:244)
        at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
        at org.apache.kafka.connect.runtime.rest.RestClient.httpRequest(RestClient.java:71)
        ... 6 more

After some trail and errors it seems like when the task is created on the leader connect node it works and if it tries to create the task on non-leader connect node then it throws the above error.经过一些跟踪和错误后,似乎在领导者连接节点上创建任务时它可以工作,如果它尝试在非领导者连接节点上创建任务,则会引发上述错误。 I am not very sure if my hypothesis is correct though.我不太确定我的假设是否正确。

Next when I force the connect cluster into standalone connect node by killing processes on other cluster nodes, the connectors and tasks get created work without any problems.接下来,当我通过终止其他集群节点上的进程来强制连接集群进入独立的连接节点时,连接器和任务将毫无问题地创建工作。

Can someone please throw some light on this issue, because currently I am unable to use Kafka connect in cluster mode.有人可以对这个问题有所了解,因为目前我无法在集群模式下使用 Kafka 连接。

Appreciate any ideas and inputs.欣赏任何想法和投入。

After some trail and errors it seems like when the task is created on the leader connect node it works and if it tries to create the task on non-leader connect node then it throws the above error.经过一些跟踪和错误后,似乎在领导者连接节点上创建任务时它可以工作,如果它尝试在非领导者连接节点上创建任务,则会引发上述错误。

I am not very sure if my hypothesis is correct though.我不太确定我的假设是否正确。

It is.这是。

You need to adjust the rest.advertised.listener of the Connect workers such that they know about one another (advertise an IP or a DNS name within the network) in addition to listeners=HTTP://0.0.0.0:8083除了listeners=HTTP://0.0.0.0:8083之外,您还需要调整 Connect 工作人员的rest.advertised.listener ,以便他们相互了解(在网络中通告 IP 或 DNS 名称)

https://kafka.apache.org/documentation/#connectconfigs https://kafka.apache.org/documentation/#connectconfigs

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM