Open KestasG opened 4 years ago
Ensure you have JMX port/hostname defined. My group is running Confluent Kafka but still utilizing CMAK for maintenance. To all for functionality to work, I defined these variables in /etc/environment. Logout of instance and back in and restart kafka. To validate it works, run jconsole locally and enter ip4-address:jmx_port. If it connects you set it up correctly.
This allows for metrics be exported from each broker. Confluent Platform 5.1.0 Kafka 2.1.0 I believe.
export KAFKA_HEAP_OPTS="-Xmx5G -Xms5G" export KAFKA_JMX_PORT=8404 export JMX_PORT=8404 export KAFKA_JMX_OPTS="-Djava.rmi.server.hostname=XX.XX.XX.XXX -Dcom.sun.management.jmxremote=true -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false"
Image: kafkamanager/kafka-manager:3.0.0.4
I got same error:
2021-01-26 07:35:32,265 - [ERROR] k.m.j.KafkaJMX$ - Failed to connect to service:jmx:rmi:///jndi/rmi://10.1.108.43:9999/jmxrmi java.rmi.ConnectException: Connection refused to host: 10.1.108.43; nested exception is: java.net.ConnectException: Connection timed out (Connection timed out) at java.rmi/sun.rmi.transport.tcp.TCPEndpoint.newSocket(Unknown Source) at java.rmi/sun.rmi.transport.tcp.TCPChannel.createConnection(Unknown Source) at java.rmi/sun.rmi.transport.tcp.TCPChannel.newConnection(Unknown Source) at java.rmi/sun.rmi.server.UnicastRef.invoke(Unknown Source) at java.rmi/java.rmi.server.RemoteObjectInvocationHandler.invokeRemoteMethod(Unknown Source) at java.rmi/java.rmi.server.RemoteObjectInvocationHandler.invoke(Unknown Source) at com.sun.proxy.$Proxy6.newClient(Unknown Source) at java.management.rmi/javax.management.remote.rmi.RMIConnector.getConnection(Unknown Source) at java.management.rmi/javax.management.remote.rmi.RMIConnector.connect(Unknown Source) at java.management/javax.management.remote.JMXConnectorFactory.connect(Unknown Source) Caused by: java.net.ConnectException: Connection timed out (Connection timed out) at java.base/java.net.PlainSocketImpl.socketConnect(Native Method) at java.base/java.net.AbstractPlainSocketImpl.doConnect(Unknown Source) at java.base/java.net.AbstractPlainSocketImpl.connectToAddress(Unknown Source) at java.base/java.net.AbstractPlainSocketImpl.connect(Unknown Source) at java.base/java.net.SocksSocketImpl.connect(Unknown Source) at java.base/java.net.Socket.connect(Unknown Source) at java.base/java.net.Socket.connect(Unknown Source) at java.base/java.net.Socket.<init>(Unknown Source) at java.base/java.net.Socket.<init>(Unknown Source) at java.rmi/sun.rmi.transport.tcp.TCPDirectSocketFactory.createSocket(Unknown Source) 2021-01-26 07:35:32,267 - [ERROR] k.m.a.c.BrokerViewCacheActor - Failed to get broker metrics for BrokerIdentity(2,10.1.108.43,9999,false,true,Map(PLAINTEXT -> 9092)) java.rmi.ConnectException: Connection refused to host: 10.1.108.43; nested exception is: java.net.ConnectException: Connection timed out (Connection timed out) at java.rmi/sun.rmi.transport.tcp.TCPEndpoint.newSocket(Unknown Source) at java.rmi/sun.rmi.transport.tcp.TCPChannel.createConnection(Unknown Source) at java.rmi/sun.rmi.transport.tcp.TCPChannel.newConnection(Unknown Source) at java.rmi/sun.rmi.server.UnicastRef.invoke(Unknown Source) at java.rmi/java.rmi.server.RemoteObjectInvocationHandler.invokeRemoteMethod(Unknown Source) at java.rmi/java.rmi.server.RemoteObjectInvocationHandler.invoke(Unknown Source) at com.sun.proxy.$Proxy6.newClient(Unknown Source) at java.management.rmi/javax.management.remote.rmi.RMIConnector.getConnection(Unknown Source) at java.management.rmi/javax.management.remote.rmi.RMIConnector.connect(Unknown Source) at java.management/javax.management.remote.JMXConnectorFactory.connect(Unknown Source) Caused by: java.net.ConnectException: Connection timed out (Connection timed out) at java.base/java.net.PlainSocketImpl.socketConnect(Native Method) at java.base/java.net.AbstractPlainSocketImpl.doConnect(Unknown Source) at java.base/java.net.AbstractPlainSocketImpl.connectToAddress(Unknown Source) at java.base/java.net.AbstractPlainSocketImpl.connect(Unknown Source) at java.base/java.net.SocksSocketImpl.connect(Unknown Source) at java.base/java.net.Socket.connect(Unknown Source) at java.base/java.net.Socket.connect(Unknown Source) at java.base/java.net.Socket.<init>(Unknown Source) at java.base/java.net.Socket.<init>(Unknown Source) at java.rmi/sun.rmi.transport.tcp.TCPDirectSocketFactory.createSocket(Unknown Source)
please help
Seems like network issue, I just open all to kafka-manager, and it works. Before I just open TCP:9999.
Using docker image kafkamanager/kafka-manager:2.0.0.2. General operations work ok, but unable to connect to JXM to get metrics. Error in logs:
2020-01-09 08:16:30,657 - [ERROR] k.m.a.c.BrokerViewCacheActor - Failed to get broker metrics for BrokerIdentity(2,10.244.7.81,9192,false,true,Map(PLAINTEXT -> 9092)) java.rmi.UnknownHostException: Unknown host: ${host}; nested exception is: java.net.UnknownHostException: ${host} at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:616) 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:129) at javax.management.remote.rmi.RMIServerImpl_Stub.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) at kafka.manager.jmx.KafkaJMX$.doWithConnection(KafkaJMX.scala:57) at kafka.manager.actor.cluster.BrokerViewCacheActor.$anonfun$updateBrokerMetrics$3(BrokerViewCacheActor.scala:359) Caused by: java.net.UnknownHostException: ${host} at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:184) 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.(Socket.java:434)
at java.net.Socket.(Socket.java:211)
at sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(RMIDirectSocketFactory.java:40)
at sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(RMIMasterSocketFactory.java:148)
at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:613)
at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:216)