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

laiyingchun pushed a commit to branch v2.4
in repository https://gitbox.apache.org/repos/asf/incubator-pegasus.git


The following commit(s) were added to refs/heads/v2.4 by this push:
     new 17a287ac6 fix: fix install zookeeper client (#1514)
17a287ac6 is described below

commit 17a287ac68053d0c505cad131b83b2de2b7d4ef3
Author: liguohao <[email protected]>
AuthorDate: Mon Jun 5 15:38:30 2023 +0800

    fix: fix install zookeeper client (#1514)
    
    issue: https://github.com/apache/incubator-pegasus/issues/1513
    
    change install zookeeper client way on `start_onebox`.
    thirdparty -> $PEGASUSU_ROOT/.zk_install
---
 scripts/start_zk.sh | 32 ++++++++++++++++++++------------
 1 file changed, 20 insertions(+), 12 deletions(-)

diff --git a/scripts/start_zk.sh b/scripts/start_zk.sh
index bdb1401f4..778e7067f 100755
--- a/scripts/start_zk.sh
+++ b/scripts/start_zk.sh
@@ -40,26 +40,34 @@ then
     exit 1
 fi
 
-ZOOKEEPER_PKG=`pwd`/thirdparty/build/Download/zookeeper/zookeeper-3.4.10.tar.gz
-if [ ! -f ${ZOOKEEPER_PKG} ]; then
-    echo "no such file \"${ZOOKEEPER_PKG}\""
-    echo "please install third-parties first"
-    exit 1
-fi
-
 cd "$INSTALL_DIR" || exit
 
-if [ ! -d zookeeper-3.4.10 ]; then
+ZOOKEEPER_ROOT=zookeeper-3.4.10
+ZOOKEEPER_TAR_NAME=${ZOOKEEPER_ROOT}.tar.gz
+ZOOKEEPER_TAR_MD5_VALUE="e4cf1b1593ca870bf1c7a75188f09678"
+
+if [ ! -f $ZOOKEEPER_TAR_NAME ]; then
+    echo "Downloading zookeeper..."
+    
download_url="http://pegasus-thirdparty-package.oss-cn-beijing.aliyuncs.com/zookeeper-3.4.10.tar.gz";
+    if ! wget -T 5 -t 1 $download_url; then
+        echo "ERROR: download zookeeper failed"
+        exit 1
+    fi
+    if [ `md5sum $ZOOKEEPER_TAR_NAME | awk '{print$1}'` != 
$ZOOKEEPER_TAR_MD5_VALUE ]; then
+        echo "check file $ZOOKEEPER_TAR_NAME md5sum failed!"
+        exit 1
+    fi
+fi
+
+if [ ! -d $ZOOKEEPER_ROOT ]; then
     echo "Decompressing zookeeper..."
-    cp ${ZOOKEEPER_PKG} .
-    tar xf zookeeper-3.4.10.tar.gz
-    if [ $? -ne 0 ]; then
+    if ! tar xf $ZOOKEEPER_TAR_NAME; then
         echo "ERROR: decompress zookeeper failed"
         exit 1
     fi
 fi
 
-ZOOKEEPER_HOME=`pwd`/zookeeper-3.4.10
+ZOOKEEPER_HOME=`pwd`/$ZOOKEEPER_ROOT
 ZOOKEEPER_PORT=$PORT
 
 cp $ZOOKEEPER_HOME/conf/zoo_sample.cfg $ZOOKEEPER_HOME/conf/zoo.cfg


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to