Community Articles
Find and share helpful community-sourced technical articles
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.
Labels (1)

SYMPTOM:

The following jmx tool command is failing with "port already in user" error

/usr/hdp/current/kafka-broker/bin/kafka-run-class.sh kafka.tools.JmxTool --object-name kafka.server:type=BrokerTopicMetrics,name=MessagesInPerSec  --jmx-url service:jmx:rmi:///jndi/rmi://`hostname`:1099/jmxrmi

ROOT CAUSE:

JMX tool invoke the kafka-run-class.sh after reading kafka-env.sh, since we have already have export $JMX_PORT=1099 there then it tried to bind the same host while invoking the jmx tool which result into error.

WORKAROUND:

NA

RESOLUTION:

edit kafka-run-class.sh

Replace section 
# JMX port to use 
if [ $JMX_PORT ]; then 
KAFKA_JMX_OPTS="$KAFKA_JMX_OPTS -Dcom.sun.management.jmxremote.port=$JMX_PORT" 
fi 
To the following: 
Changed security protocol to the correct ones and kafka cli script as follows. 
# JMX port to use 
if [ $ISKAFKASERVER = "true" ]; then 
JMX_REMOTE_PORT=$JMX_PORT 
else 
JMX_REMOTE_PORT=$CLIENT_JMX_PORT 
fi 
if [ $JMX_REMOTE_PORT ]; then 
KAFKA_JMX_OPTS="$KAFKA_JMX_OPTS -Dcom.sun.management.jmxremote.port=$JMX_REMOTE_PORT" 
fi




3,905 Views
Don't have an account?
Coming from Hortonworks? Activate your account here
Version history
Revision #:
1 of 1
Last update:
‎12-22-2016 04:42 PM
Updated by:
 
Contributors
Top Kudoed Authors