You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by yo...@apache.org on 2021/12/23 14:03:50 UTC

[pulsar] 05/14: feat(cli): support autorecovery service in pulsar cli (#12985)

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

yong pushed a commit to branch branch-2.8
in repository https://gitbox.apache.org/repos/asf/pulsar.git

commit b613f520efdd334edfc157d0d51314f80842c29f
Author: Eric Shen <er...@outlook.com>
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
    
    (cherry picked from commit f192209af58e86a2c6da4130956b172b2d1ddc13)
---
 bin/pulsar        | 4 ++++
 bin/pulsar-daemon | 4 ++++
 2 files changed, 8 insertions(+)

diff --git a/bin/pulsar b/bin/pulsar
index 29bda52..bea358a 100755
--- a/bin/pulsar
+++ b/bin/pulsar
@@ -142,6 +142,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
@@ -353,6 +354,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 196aaa7..dce11fd 100755
--- a/bin/pulsar-daemon
+++ b/bin/pulsar-daemon
@@ -31,6 +31,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
@@ -106,6 +107,9 @@ case $command in
     (proxy)
         echo "doing $startStop $command ..."
         ;;
+    (autorecovery)
+        echo "doing $startStop $command ..."
+        ;;
     (*)
         echo "Error: unknown service name $command"
         usage