From 3e05ee54bdb1f15eb5b40a6e981572dda49d4175 Mon Sep 17 00:00:00 2001 From: Yingchun Lai Date: Tue, 5 Dec 2023 12:02:32 +0800 Subject: [PATCH] feat: source config_hdfs.sh automatically before starting onebox (#1708) When run Pegasus to use the feature of backup data to HDFS (restore data from HDFS is the same), it's needed to set the CLASSPATH enviroment variables, now it is done by scripts/config_hdfs.sh. However, we have to source this script manually before starting onebox. This patch sources the script in ./run.sh automatically, updates config_hdfs.sh to download hadoop package is it's not exist, and removes explicilt calling of scripts/config_hdfs.sh in CI. --- run.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/run.sh b/run.sh index 182776461c..e1260cc358 100755 --- a/run.sh +++ b/run.sh @@ -685,7 +685,7 @@ function run_start_onebox() exit 1 fi - echo "HDFS_SERVICE_ARGS $HDFS_SERVICE_ARGS" + source "${ROOT}"/scripts/config_hdfs.sh if [ $USE_PRODUCT_CONFIG == "true" ]; then [ -z "${CONFIG_FILE}" ] && CONFIG_FILE=${ROOT}/src/server/config.ini [ ! -f "${CONFIG_FILE}" ] && { echo "${CONFIG_FILE} is not exist"; exit 1; } @@ -924,6 +924,7 @@ function run_start_onebox_instance() esac shift done + source "${ROOT}"/scripts/config_hdfs.sh if [ $META_ID = "0" -a $REPLICA_ID = "0" -a $COLLECTOR_ID = "0" ]; then echo "ERROR: no meta_id or replica_id or collector set" exit 1