pulsar-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] merlimat closed pull request #876: Separate ports used by global and local zookeeper
Date Thu, 01 Jan 1970 00:00:00 GMT
merlimat closed pull request #876: Separate ports used by global and local zookeeper
URL: https://github.com/apache/incubator-pulsar/pull/876
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/bin/pulsar b/bin/pulsar
index 3dd3fc982..1bfd99528 100755
--- a/bin/pulsar
+++ b/bin/pulsar
@@ -207,7 +207,7 @@ elif [ $COMMAND == "global-zookeeper" ]; then
     PULSAR_LOG_FILE=${PULSAR_LOG_FILE:-"global-zookeeper.log"}
     # Allow global ZK to turn into read-only mode when it cannot reach the quorum
     OPTS="${OPTS} -Dreadonlymode.enabled=true"
-    exec $JAVA $OPTS -Dpulsar.log.file=$PULSAR_LOG_FILE org.apache.pulsar.zookeeper.ZooKeeperStarter
$PULSAR_GLOBAL_ZK_CONF $@
+    exec $JAVA $OPTS -Dpulsar.log.file=$PULSAR_LOG_FILE org.apache.pulsar.zookeeper.GlobalZooKeeperStarter
$PULSAR_GLOBAL_ZK_CONF $@
 elif [ $COMMAND == "discovery" ]; then
     PULSAR_LOG_FILE=${PULSAR_LOG_FILE:-"discovery.log"}
     exec $JAVA $OPTS -Dpulsar.log.file=$PULSAR_LOG_FILE org.apache.pulsar.discovery.service.server.DiscoveryServiceStarter
$PULSAR_DISCOVERY_CONF $@
diff --git a/conf/bkenv.sh b/conf/bkenv.sh
index c2484825d..6fc6c42f5 100644
--- a/conf/bkenv.sh
+++ b/conf/bkenv.sh
@@ -39,7 +39,7 @@ BOOKIE_MEM=" -Xms2g -Xmx2g -XX:MaxDirectMemorySize=2g"
 BOOKIE_GC=" -XX:+UseG1GC -XX:MaxGCPauseMillis=10 -XX:+ParallelRefProcEnabled -XX:+UnlockExperimentalVMOptions
-XX:+AggressiveOpts -XX:+DoEscapeAnalysis -XX:ParallelGCThreads=32 -XX:ConcGCThreads=32 -XX:G1NewSizePercent=50
-XX:+DisableExplicitGC -XX:-ResizePLAB"
 
 # Extra options to be passed to the jvm
-BOOKIE_EXTRA_OPTS="${BOOKIE_MEM} ${BOOKIE_GC} -Dio.netty.leakDetectionLevel=disabled -Dio.netty.recycler.maxCapacity.default=1000
-Dio.netty.recycler.linkCapacity=1024"
+BOOKIE_EXTRA_OPTS="${BOOKIE_EXTRA_OPTS} ${BOOKIE_MEM} ${BOOKIE_GC} -Dio.netty.leakDetectionLevel=disabled
-Dio.netty.recycler.maxCapacity.default=1000 -Dio.netty.recycler.linkCapacity=1024"
 
 # Add extra paths to the bookkeeper classpath
 # BOOKIE_EXTRA_CLASSPATH=
diff --git a/conf/pulsar_env.sh b/conf/pulsar_env.sh
index 17688b92c..f600e6d20 100644
--- a/conf/pulsar_env.sh
+++ b/conf/pulsar_env.sh
@@ -48,7 +48,7 @@ PULSAR_MEM=" -Xms2g -Xmx2g -XX:MaxDirectMemorySize=4g"
 PULSAR_GC=" -XX:+UseG1GC -XX:MaxGCPauseMillis=10 -XX:+ParallelRefProcEnabled -XX:+UnlockExperimentalVMOptions
-XX:+AggressiveOpts -XX:+DoEscapeAnalysis -XX:ParallelGCThreads=32 -XX:ConcGCThreads=32 -XX:G1NewSizePercent=50
-XX:+DisableExplicitGC -XX:-ResizePLAB"
 
 # Extra options to be passed to the jvm
-PULSAR_EXTRA_OPTS="${PULSAR_MEM} ${PULSAR_GC} -Dio.netty.leakDetectionLevel=disabled -Dio.netty.recycler.maxCapacity.default=1000
-Dio.netty.recycler.linkCapacity=1024"
+PULSAR_EXTRA_OPTS="${PULSAR_EXTRA_OPTS} ${PULSAR_MEM} ${PULSAR_GC} -Dio.netty.leakDetectionLevel=disabled
-Dio.netty.recycler.maxCapacity.default=1000 -Dio.netty.recycler.linkCapacity=1024"
 
 # Add extra paths to the bookkeeper classpath
 # PULSAR_EXTRA_CLASSPATH=
diff --git a/conf/pulsar_tools_env.sh b/conf/pulsar_tools_env.sh
index 0186db7d5..7eca6071d 100755
--- a/conf/pulsar_tools_env.sh
+++ b/conf/pulsar_tools_env.sh
@@ -48,7 +48,7 @@ PULSAR_MEM=" -Xmx256m -XX:MaxDirectMemorySize=256m"
 PULSAR_GC=" -client "
 
 # Extra options to be passed to the jvm
-PULSAR_EXTRA_OPTS="${PULSAR_MEM} ${PULSAR_GC} -Dio.netty.leakDetectionLevel=disabled"
+PULSAR_EXTRA_OPTS="${PULSAR_EXTRA_OPTS} ${PULSAR_MEM} ${PULSAR_GC} -Dio.netty.leakDetectionLevel=disabled"
 
 # Add extra paths to the bookkeeper classpath
 # PULSAR_EXTRA_CLASSPATH=
diff --git a/pulsar-zookeeper/src/main/java/org/apache/pulsar/zookeeper/GlobalZooKeeperStarter.java
b/pulsar-zookeeper/src/main/java/org/apache/pulsar/zookeeper/GlobalZooKeeperStarter.java
new file mode 100644
index 000000000..d70885b7e
--- /dev/null
+++ b/pulsar-zookeeper/src/main/java/org/apache/pulsar/zookeeper/GlobalZooKeeperStarter.java
@@ -0,0 +1,30 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.pulsar.zookeeper;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class GlobalZooKeeperStarter extends ZooKeeperStarter {
+    public static void main(String[] args) throws Exception {
+        start(args, "8001");
+    }
+
+    private static final Logger log = LoggerFactory.getLogger(GlobalZooKeeperStarter.class);
+}
diff --git a/pulsar-zookeeper/src/main/java/org/apache/pulsar/zookeeper/ZooKeeperStarter.java
b/pulsar-zookeeper/src/main/java/org/apache/pulsar/zookeeper/ZooKeeperStarter.java
index 43cfd4442..6e1db718b 100644
--- a/pulsar-zookeeper/src/main/java/org/apache/pulsar/zookeeper/ZooKeeperStarter.java
+++ b/pulsar-zookeeper/src/main/java/org/apache/pulsar/zookeeper/ZooKeeperStarter.java
@@ -35,6 +35,10 @@
 
 public class ZooKeeperStarter {
     public static void main(String[] args) throws Exception {
+        start(args, "8000");
+    }
+
+    protected static void start(String[] args, String defaultStatsPort) throws Exception
{
         // Register basic JVM metrics
         DefaultExports.initialize();
 
@@ -42,7 +46,7 @@ public static void main(String[] args) throws Exception {
         AgentLoader.loadAgentClass(Agent.class.getName(), null);
 
         // Start Jetty to serve stats
-        int port = Integer.parseInt(System.getProperties().getProperty("stats_server_port",
"8080"));
+        int port = Integer.parseInt(System.getProperties().getProperty("stats_server_port",
defaultStatsPort));
 
         log.info("Starting ZK stats HTTP server at port {}", port);
         InetSocketAddress httpEndpoint = InetSocketAddress.createUnresolved("0.0.0.0", port);
diff --git a/site/docs/latest/deployment/Monitoring.md b/site/docs/latest/deployment/Monitoring.md
index 61079ffdf..2e1ae4d74 100644
--- a/site/docs/latest/deployment/Monitoring.md
+++ b/site/docs/latest/deployment/Monitoring.md
@@ -57,13 +57,17 @@ http://$BROKER_ADDRESS:8080/metrics
 
 ### ZooKeeper stats
 
-The ZooKeeper server and clients that are shipped with Pulsar have been instrumented to expose
+The local/global ZooKeeper server and clients that are shipped with Pulsar have been instrumented
to expose
 detailed stats through Prometheus as well.
 
 ```shell
-http://$ZK_SERVER:8080/metrics
+http://$LOCAL_ZK_SERVER:8000/metrics
+http://$GLOBAL_ZK_SERVER:8001/metrics
 ```
 
+The default port of local ZooKeeper is `8000` and that of global ZooKeeper is `8001`.
+These can be changed by specifying system property `stats_server_port`.
+
 ### BookKeeper stats
 
 For BookKeeper you can configure the stats frameworks by changing the `statsProviderClass`
in


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

Mime
View raw message