1.启动后第一个报错如下:
[error] k.m.a.c.BrokerViewCacheActor - Failed to get broker metrics for BrokerIdentity(1,192.168.204.111,9999,false,true,Map(PLAINTEXT -> 9092))
java.rmi.ConnectException: Connection refused to host: 127.0.0.1; nested exception is:
修改方法:
修改kafka-server-start.sh
if [ "x$KAFKA_HEAP_OPTS" = "x" ]; then
export KAFKA_HEAP_OPTS="-Xmx1G -Xms1G"
export JMX_PORT="9999"
fi
增加红色部分,指定jmx
的端口
同时修改kafka-run-class.sh
# JMX settings
if [ -z "$KAFKA_JMX_OPTS" ]; then
KAFKA_JMX_OPTS="-Djava.rmi.server.hostname=192.168.204.108 -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false "
fi
增加红色部分。
2.第二个报错
java.io.IOException: Failed to retrieve RMIServer stub: javax.naming.CommunicationException [Root exception is java.rmi.ConnectIOException: error during JRMP connection establishment; nested exception is:
解决方法:
不要开启JMX with SSL功能。