Kafka经理无法连接到经纪人

qc6wkl3g  于 2021-06-06  发布在  Kafka
关注(0)|答案(2)|浏览(380)

我有三个经纪人( brker1 , broker2 以及 broker3 ),我的Kafka马槽可以连接到 broker2 但无法与剩下的两个经纪人取得联系( broker1 以及 broker3 ). 我重新开始 kafka-manager , broker1 以及 broker3 同样,但仍然没有连接到这两个经纪人。
注:Kafka在3个经纪人身上运行
这个日志是我从 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.(Socket.java:434) ~[na:1.8.0_121]
at java.net.Socket.(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...

我正在使用 `kafka-manager-1.3.2.1` 3个代理(代理1、代理2和代理3)正在运行
这是我从broker1获得的日志(kafka manager无法连接到此broker)

[2018-05-08 07:10:11,217] INFO [GroupCoordinator 1]: Loading group metadata for topic-1 with generation 27 (kafka.coordinator.GroupCoordinator)
[2018-05-08 07:10:11,217] INFO [GroupCoordinator 1]: Loading group metadata for topic-2 with generation 3 (kafka.coordinator.GroupCoordinator)
[2018-05-08 07:10:11,217] INFO [Group Metadata Manager on Broker 1]: Finished loading offsets from [__consumer_offsets,2] in 28 milliseconds. (kafka.coordinator.GroupMetadataManager)
[2018-05-08 07:10:11,218] INFO [Group Metadata Manager on Broker 1]: Loading offsets and group metadata from [__consumer_offsets,16] (kafka.coordinator.GroupMetadataManager)
[2018-05-08 07:10:11,224] INFO [Group Metadata Manager on Broker 1]: Finished loading offsets from [__consumer_offsets,16] in 6 milliseconds. (kafka.coordinator.GroupMetadataManager)
[2018-05-08 07:17:53,774] INFO [Group Metadata Manager on Broker 1]: Removed 0 expired offsets in 4 milliseconds. (kafka.coordinator.GroupMetadataManager)

xpszyzbs

xpszyzbs1#

似乎您需要发布jmx端口/主机,以便kafka管理器能够发现代理,这些代理由brokerstarter脚本中的以下参数控制。

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

更多详情请参见:https://github.com/yahoo/kafka-manager/issues/214

w46czmvw

w46czmvw2#

错误“连接被拒绝”可能表示没有进程监听该端口,或者该计算机上有防火墙阻止该端口。
从Kafka管理器运行的机器上,你能做什么 nc broker3 9092 以及 nc broker3 9999 ? 如果这两个命令“挂起”,就意味着这不仅仅是Kafka经理人的问题。
我意识到这是一个老问题,我只是偶然发现它,因为我正在寻找其他东西。

相关问题