zookeeper-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From an...@apache.org
Subject [zookeeper] branch master updated: ZOOKEEPER-3606: add JMXHOSTNAME to zkServer.sh to enable user to chan…
Date Tue, 17 Dec 2019 12:59:15 GMT
This is an automated email from the ASF dual-hosted git repository.

andor pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/zookeeper.git


The following commit(s) were added to refs/heads/master by this push:
     new 48e5eaa  ZOOKEEPER-3606: add JMXHOSTNAME to zkServer.sh to enable user to chan…
48e5eaa is described below

commit 48e5eaadffd8e23d2f47fe3eb0d0437b172dcd39
Author: Chia-Ping Tsai <chia7712@gmail.com>
AuthorDate: Tue Dec 17 13:59:09 2019 +0100

    ZOOKEEPER-3606: add JMXHOSTNAME to zkServer.sh to enable user to chan…
    
    Add a extra option "JMXHOSTNAME" used to define the hostname bound by metrics service.
It is useful to users who make metrics service to response specific hostname when using JMX.
    
    Author: Chia-Ping Tsai <chia7712@gmail.com>
    
    Reviewers: eolivelli@apache.org, fangmin@apache.org
    
    Closes #1141 from chia7712/fix_3606
---
 bin/zkServer.sh | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/bin/zkServer.sh b/bin/zkServer.sh
index ec3db14..10ead60 100755
--- a/bin/zkServer.sh
+++ b/bin/zkServer.sh
@@ -68,7 +68,13 @@ then
     echo "ZooKeeper remote JMX authenticate set to $JMXAUTH" >&2
     echo "ZooKeeper remote JMX ssl set to $JMXSSL" >&2
     echo "ZooKeeper remote JMX log4j set to $JMXLOG4J" >&2
-    ZOOMAIN="-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=$JMXPORT
-Dcom.sun.management.jmxremote.authenticate=$JMXAUTH -Dcom.sun.management.jmxremote.ssl=$JMXSSL
-Dzookeeper.jmx.log4j.disable=$JMXLOG4J org.apache.zookeeper.server.quorum.QuorumPeerMain"
+    if [ "x$JMXHOSTNAME" = "x" ]
+    then
+      ZOOMAIN="-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=$JMXPORT
-Dcom.sun.management.jmxremote.authenticate=$JMXAUTH -Dcom.sun.management.jmxremote.ssl=$JMXSSL
-Dzookeeper.jmx.log4j.disable=$JMXLOG4J org.apache.zookeeper.server.quorum.QuorumPeerMain"
+    else
+      echo "ZooKeeper remote JMX Hostname set to $JMXHOSTNAME" >&2
+      ZOOMAIN="-Dcom.sun.management.jmxremote -Djava.rmi.server.hostname=$JMXHOSTNAME -Dcom.sun.management.jmxremote.port=$JMXPORT
-Dcom.sun.management.jmxremote.authenticate=$JMXAUTH -Dcom.sun.management.jmxremote.ssl=$JMXSSL
-Dzookeeper.jmx.log4j.disable=$JMXLOG4J org.apache.zookeeper.server.quorum.QuorumPeerMain"
+    fi
   fi
 else
     echo "JMX disabled by user request" >&2


Mime
View raw message