You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kafka.apache.org by ce...@apache.org on 2022/12/02 03:46:44 UTC
[kafka] branch trunk updated: KAFKA-14430: Specify JMX RMI port system property when not already set (#12898)
This is an automated email from the ASF dual-hosted git repository.
cegerton pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/kafka.git
The following commit(s) were added to refs/heads/trunk by this push:
new 41d075ba140 KAFKA-14430: Specify JMX RMI port system property when not already set (#12898)
41d075ba140 is described below
commit 41d075ba140fbd573a55ce2b18a1b53a44703b76
Author: FUNKYE <36...@qq.com>
AuthorDate: Fri Dec 2 11:46:37 2022 +0800
KAFKA-14430: Specify JMX RMI port system property when not already set (#12898)
Reviewers: Andriy Redko <an...@aiven.io>, Chris Egerton <ch...@aiven.io>
---
bin/kafka-run-class.sh | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/bin/kafka-run-class.sh b/bin/kafka-run-class.sh
index 6d8c38f9b17..fa0617f2489 100755
--- a/bin/kafka-run-class.sh
+++ b/bin/kafka-run-class.sh
@@ -213,6 +213,10 @@ fi
# JMX port to use
if [ $JMX_PORT ]; then
KAFKA_JMX_OPTS="$KAFKA_JMX_OPTS -Dcom.sun.management.jmxremote.port=$JMX_PORT "
+ if ! echo "$KAFKA_JMX_OPTS" | grep -qF -- '-Dcom.sun.management.jmxremote.rmi.port=' ; then
+ # If unset, set the RMI port to address issues with monitoring Kafka running in containers
+ KAFKA_JMX_OPTS="$KAFKA_JMX_OPTS -Dcom.sun.management.jmxremote.rmi.port=$JMX_PORT"
+ fi
fi
# Log directory to use