Kafka经理无法连接到经纪人

时间:2018-05-08 06:38:59

标签: apache-kafka apache-kafka-connect

我有3个经纪人(brker1broker2broker3),我的kafka经理可以连接到broker2但无法与剩余的两个经纪人联系({ {1}}和broker1)。我重新启动了broker3kafka-managerbroker1,但仍然没有连接到这两个经纪人。

注意: - kafka正在3个经纪人身上运行

这是我从broker3

获得的日志
kafka-manage

我正在使用[error] k.m.a.c.BrokerViewCacheActor - Failed to get broker metrics for BrokerIdentity(3,broker3,9092,9999,false) java.rmi.ConnectException: Connection refused to host: IP; nested exception is: java.net.ConnectException: Connection refused (Connection refused) at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:619) ~[na:1.8.0_121] at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:216) ~[na:1.8.0_121] at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:202) ~[na:1.8.0_121] at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:130) ~[na:1.8.0_121] at java.rmi.server.RemoteObjectInvocationHandler.invokeRemoteMethod(RemoteObjectInvocationHandler.java:227) ~[na:1.8.0_121] at java.rmi.server.RemoteObjectInvocationHandler.invoke(RemoteObjectInvocationHandler.java:179) ~[na:1.8.0_121] at com.sun.proxy.$Proxy6.newClient(Unknown Source) ~[na:na] at javax.management.remote.rmi.RMIConnector.getConnection(RMIConnector.java:2430) ~[na:1.8.0_121] at javax.management.remote.rmi.RMIConnector.connect(RMIConnector.java:308) ~[na:1.8.0_121] at javax.management.remote.JMXConnectorFactory.connect(JMXConnectorFactory.java:270) ~[na:1.8.0_121] Caused by: java.net.ConnectException: Connection refused (Connection refused) at java.net.PlainSocketImpl.socketConnect(Native Method) ~[na:1.8.0_121] at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350) ~[na:1.8.0_121] at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206) ~[na:1.8.0_121] at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188) ~[na:1.8.0_121] at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392) ~[na:1.8.0_121] at java.net.Socket.connect(Socket.java:589) ~[na:1.8.0_121] at java.net.Socket.connect(Socket.java:538) ~[na:1.8.0_121] at java.net.Socket.<init>(Socket.java:434) ~[na:1.8.0_121] at java.net.Socket.<init>(Socket.java:211) ~[na:1.8.0_121] at sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(RMIDirectSocketFactory.java:40) ~[na:1.8.0_121] [info] k.m.a.KafkaManagerActor - Updating internal state...

3个经纪人(broker1,broker2和broker3)正在运行

这是我从broker1获取的日志(kafka-manager无法连接到此代理)

kafka-manager-1.3.2.1

2 个答案:

答案 0 :(得分:0)

错误“连接被拒绝”可能表明该端口上没有进程在监听,或者该计算机上有防火墙阻止了该端口。

在运行kafka-manager的计算机上,您可以执行nc broker3 9092nc broker3 9999吗?如果这两个命令“挂起”,则意味着这不仅仅是Kafka Manager问题。

我意识到这是一个古老的问题,我在寻找其他东西时偶然碰到了它。

答案 1 :(得分:0)

似乎您需要发布JMX PORT / HOST,以便Kafka-Manager能够发现代理,这些代理由代理启动脚本中的以下参数控制。

Djava.rmi.server.hostname=${ip}
JMX_PORT=9997 

有关更多详细信息,请遵循:https://github.com/yahoo/kafka-manager/issues/214