Skip to content

Commit

Permalink
feat: source config_hdfs.sh automatically before starting onebox (apa…
Browse files Browse the repository at this point in the history
…che#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.
  • Loading branch information
acelyc111 committed Jan 31, 2024
1 parent 0e49879 commit 3e05ee5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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; }
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 3e05ee5

Please sign in to comment.