KafkaManager报错
2019-05-19 14:21:53,817 - [ERROR] k.m.a.c.BrokerViewCacheActor - Failed to get broker metrics for BrokerIdentity(128,192.168.2.128,9999,true,false,Map(SASL_PLAINTEXT -> 19092))
java.rmi.ConnectException: Connection refused to host: 127.0.0.1; nested exception is: java.net.ConnectException: Connection refused (Connection refused)at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:619)at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:216)at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:202)at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:130)at java.rmi.server.RemoteObjectInvocationHandler.invokeRemoteMethod(RemoteObjectInvocationHandler.java:227)at java.rmi.server.RemoteObjectInvocationHandler.invoke(RemoteObjectInvocationHandler.java:179)at com.sun.proxy.$Proxy5.newClient(Unknown Source)at javax.management.remote.rmi.RMIConnector.getConnection(RMIConnector.java:2430)at javax.management.remote.rmi.RMIConnector.connect(RMIConnector.java:308)at javax.management.remote.JMXConnectorFactory.connect(JMXConnectorFactory.java:270)
Caused by: java.net.ConnectException: Connection refused (Connection refused)at java.net.PlainSocketImpl.socketConnect(Native Method)at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)at java.net.Socket.connect(Socket.java:589)at java.net.Socket.connect(Socket.java:538)at java.net.Socket.<init>(Socket.java:434)at java.net.Socket.<init>(Socket.java:211)at sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(RMIDirectSocketFactory.java:40)
修改kafka-run-class.sh,增加“-Djava.rmi.server.hostname=192.168.2.128”
if [ -z "$KAFKA_JMX_OPTS" ]; then
KAFKA_JMX_OPTS="-Djava.rmi.server.hostname=192.168.2.128 -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false "
fi
重启,恢复正常