Support Questions

Find answers, ask questions, and share your expertise

i am trying to get jmx matrics from kafka but it failing with following exception

avatar
Explorer

bin/kafka-run-class.sh kafka.tools.JmxTool --jmx-url service:jmx:rmi:///jndi/rmi://`hostname`:1099/jmxrmi

1 ACCEPTED SOLUTION

avatar
Super Guru

what exception you are getting here?

View solution in original post

3 REPLIES 3

avatar
Super Guru

what exception you are getting here?

avatar
Explorer

Exception in thread "main" java.io.IOException: Failed to retrieve RMIServer stub: javax.naming.ServiceUnavailableException [Root exception is java.rmi.ConnectException: Connection refused to host: rnd.local; nested exception is:

java.net.ConnectException: Connection refused]

at javax.management.remote.rmi.RMIConnector.connect(RMIConnector.java:369)

at javax.management.remote.JMXConnectorFactory.connect(JMXConnectorFactory.java:270)

at kafka.tools.JmxTool$.main(JmxTool.scala:83)

at kafka.tools.JmxTool.main(JmxTool.scala)

Caused by: javax.naming.ServiceUnavailableException [Root exception is java.rmi.ConnectException: Connection refused to host: rnd.local; nested exception is:

java.net.ConnectException: Connection refused]

at com.sun.jndi.rmi.registry.RegistryContext.lookup(RegistryContext.java:122)

at com.sun.jndi.toolkit.url.GenericURLContext.lookup(GenericURLContext.java:205)

at javax.naming.InitialContext.lookup(InitialContext.java:417)

at javax.management.remote.rmi.RMIConnector.findRMIServerJNDI(RMIConnector.java:1955)

at javax.management.remote.rmi.RMIConnector.findRMIServer(RMIConnector.java:1922)

at javax.management.remote.rmi.RMIConnector.connect(RMIConnector.java:287)

... 3 more

avatar
Super Guru

@akshay singh check if kafka process is running with these parameters

-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=9999 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false

see a similar issue when jmx is not bound to port in HDP distribution so you need to set JMX_PORT env variable and restart kafka process