Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(HDFS): Add hdfs_service related configs in server.ini and run.sh #1705

Merged
merged 2 commits into from
Nov 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -690,6 +690,8 @@ function usage_start_onebox()
echo " ./src/server/config.ini in production env"
echo " --use_product_config"
echo " use the product config template"
echo " --hdfs_service_args"
echo " set the 'args' value of section '[block_service.hdfs_service]', it's a space separated HDFS namenode host:port and path string, for example: '127.0.0.1:8020 /pegasus'. Default is empty"
echo " --opts"
echo " update configs before start onebox, the configs are in the form of 'key1=value1,key2=value2'"
}
Expand All @@ -705,6 +707,7 @@ function run_start_onebox()
SERVER_PATH=${BUILD_LATEST_DIR}/output/bin/pegasus_server
CONFIG_FILE=""
USE_PRODUCT_CONFIG=false
HDFS_SERVICE_ARGS=""
OPTS=""

while [[ $# > 0 ]]; do
Expand Down Expand Up @@ -747,6 +750,11 @@ function run_start_onebox()
--use_product_config)
USE_PRODUCT_CONFIG=true
;;
--hdfs_service_args)
HDFS_SERVICE_ARGS="$2 $3"
shift
shift
;;
--opts)
OPTS="$2"
shift
Expand Down Expand Up @@ -776,6 +784,7 @@ function run_start_onebox()
exit 1
fi

echo "HDFS_SERVICE_ARGS $HDFS_SERVICE_ARGS"
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 All @@ -789,6 +798,7 @@ function run_start_onebox()
sed -i 's/%{slog.dir}//g' ${ROOT}/config-server.ini
sed -i 's/%{data.dirs}//g' ${ROOT}/config-server.ini
sed -i 's@%{home.dir}@'"$HOME"'@g' ${ROOT}/config-server.ini
sed -i 's@%{hdfs_service_args}@'"${HDFS_SERVICE_ARGS}"'@g' ${ROOT}/config-server.ini
for i in $(seq ${META_COUNT})
do
meta_port=$((34600+i))
Expand Down
10 changes: 9 additions & 1 deletion src/server/config.ini
Original file line number Diff line number Diff line change
Expand Up @@ -301,9 +301,17 @@ stateful = true
;; recommand using cluster name as the root
cold_backup_root = %{cluster.name}
max_concurrent_uploading_file_count = 10

max_concurrent_bulk_load_downloading_count = 5

hdfs_read_limit_rate_mb_per_sec = 200
hdfs_read_batch_size_bytes = 67108864
hdfs_write_limit_rate_mb_per_sec = 200
hdfs_write_batch_size_bytes = 67108864

[block_service.hdfs_service]
type = hdfs_service
args = %{hdfs_service_args}

[pegasus.server]
rocksdb_verbose_log = false

Expand Down