This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/master by this push:
     new f192209  feat(cli): support autorecovery service in pulsar cli (#12985)
f192209 is described below

commit f192209af58e86a2c6da4130956b172b2d1ddc13
Author: Eric Shen <[email protected]>
AuthorDate: Fri Nov 26 20:08:51 2021 -0600

    feat(cli): support autorecovery service in pulsar cli (#12985)
    
    ### Motivation
    Autorecovery service will be shutdown if the zk session expired and then 
will lead the bk service shutdown together. So, in the production environment, 
it is recommand to deploy autorecovery service seperately but currently pulsar 
doesn't support it.
    
    ### Modifications
    Added the autorecovery service in pulsar cli
    Added the autorecovery service in pulsar-daemon cli
---
 bin/pulsar        | 4 ++++
 bin/pulsar-daemon | 4 ++++
 2 files changed, 8 insertions(+)

diff --git a/bin/pulsar b/bin/pulsar
index 3f009ca..9fcb4b3 100755
--- a/bin/pulsar
+++ b/bin/pulsar
@@ -141,6 +141,7 @@ where command is one of:
     sql-worker          Run a sql worker server
     sql                 Run sql CLI
     standalone          Run a broker server with local bookies and local 
zookeeper
+    autorecovery        Run an autorecovery service
 
     initialize-cluster-metadata     One-time metadata initialization
     delete-cluster-metadata         Delete a cluster's metadata
@@ -347,6 +348,9 @@ elif [ $COMMAND == "functions-worker" ]; then
 elif [ $COMMAND == "standalone" ]; then
     PULSAR_LOG_FILE=${PULSAR_LOG_FILE:-"pulsar-standalone.log"}
     exec $JAVA $LOG4J2_SHUTDOWN_HOOK_DISABLED $OPTS ${ZK_OPTS} 
-Dpulsar.log.file=$PULSAR_LOG_FILE org.apache.pulsar.PulsarStandaloneStarter 
--config $PULSAR_STANDALONE_CONF $@
+elif [ ${COMMAND} == "autorecovery" ]; then
+    PULSAR_LOG_FILE=${PULSAR_LOG_FILE:-"pulsar-autorecovery.log"}
+    exec $JAVA $OPTS -Dpulsar.log.file=$PULSAR_LOG_FILE 
org.apache.bookkeeper.replication.AutoRecoveryMain --conf 
$PULSAR_BOOKKEEPER_CONF $@
 elif [ $COMMAND == "initialize-cluster-metadata" ]; then
     exec $JAVA $OPTS org.apache.pulsar.PulsarClusterMetadataSetup $@
 elif [ $COMMAND == "delete-cluster-metadata" ]; then
diff --git a/bin/pulsar-daemon b/bin/pulsar-daemon
index 824bb98..05ee12a 100755
--- a/bin/pulsar-daemon
+++ b/bin/pulsar-daemon
@@ -30,6 +30,7 @@ where command is one of:
     functions-worker    Run a functions worker server
     standalone          Run a standalone Pulsar service
     proxy               Run a Proxy Pulsar service
+    autorecovery        Run an autorecovery service
 
 where argument is one of:
     -force (accepted only with stop command): Decides whether to stop the 
server forcefully if not stopped by normal shutdown
@@ -102,6 +103,9 @@ case $command in
     (proxy)
         echo "doing $startStop $command ..."
         ;;
+    (autorecovery)
+        echo "doing $startStop $command ..."
+        ;;
     (*)
         echo "Error: unknown service name $command"
         usage

Reply via email to