2020-02-20 20:49:38 +08:00
|
|
|
#!/bin/bash
|
|
|
|
#
|
|
|
|
# Licensed to the Apache Software Foundation (ASF) under one or more
|
|
|
|
# contributor license agreements. See the NOTICE file distributed with
|
|
|
|
# this work for additional information regarding copyright ownership.
|
|
|
|
# The ASF licenses this file to You under the Apache License, Version 2.0
|
|
|
|
# (the "License"); you may not use this file except in compliance with
|
|
|
|
# the License. You may obtain a copy of the License at
|
|
|
|
#
|
|
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
#
|
|
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
|
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
# See the License for the specific language governing permissions and
|
|
|
|
# limitations under the License.
|
|
|
|
#
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
echo "init env variables"
|
|
|
|
|
2021-02-23 14:47:10 +08:00
|
|
|
# Define parameters default value
|
|
|
|
|
2020-02-20 20:49:38 +08:00
|
|
|
#============================================================================
|
|
|
|
# Database Source
|
|
|
|
#============================================================================
|
2020-07-16 16:36:29 +08:00
|
|
|
export DATABASE_HOST=${DATABASE_HOST:-"127.0.0.1"}
|
|
|
|
export DATABASE_PORT=${DATABASE_PORT:-"5432"}
|
|
|
|
export DATABASE_USERNAME=${DATABASE_USERNAME:-"root"}
|
|
|
|
export DATABASE_PASSWORD=${DATABASE_PASSWORD:-"root"}
|
|
|
|
export DATABASE_DATABASE=${DATABASE_DATABASE:-"dolphinscheduler"}
|
|
|
|
export DATABASE_TYPE=${DATABASE_TYPE:-"postgresql"}
|
|
|
|
export DATABASE_DRIVER=${DATABASE_DRIVER:-"org.postgresql.Driver"}
|
|
|
|
export DATABASE_PARAMS=${DATABASE_PARAMS:-"characterEncoding=utf8"}
|
2020-02-20 20:49:38 +08:00
|
|
|
|
|
|
|
#============================================================================
|
2021-02-23 14:47:10 +08:00
|
|
|
# Common
|
2020-02-20 20:49:38 +08:00
|
|
|
#============================================================================
|
2021-02-26 20:28:56 +08:00
|
|
|
# dolphinscheduler env
|
|
|
|
export HADOOP_HOME=${HADOOP_HOME:-"/opt/soft/hadoop"}
|
|
|
|
export HADOOP_CONF_DIR=${HADOOP_CONF_DIR:-"/opt/soft/hadoop/etc/hadoop"}
|
|
|
|
export SPARK_HOME1=${SPARK_HOME1:-"/opt/soft/spark1"}
|
|
|
|
export SPARK_HOME2=${SPARK_HOME2:-"/opt/soft/spark2"}
|
|
|
|
export PYTHON_HOME=${PYTHON_HOME:-"/usr/bin/python"}
|
|
|
|
export JAVA_HOME=${JAVA_HOME:-"/usr/lib/jvm/java-1.8-openjdk"}
|
|
|
|
export HIVE_HOME=${HIVE_HOME:-"/opt/soft/hive"}
|
|
|
|
export FLINK_HOME=${FLINK_HOME:-"/opt/soft/flink"}
|
|
|
|
export DATAX_HOME=${DATAX_HOME:-"/opt/soft/datax/bin/datax.py"}
|
|
|
|
# common env
|
2020-03-08 15:56:24 +08:00
|
|
|
export DOLPHINSCHEDULER_DATA_BASEDIR_PATH=${DOLPHINSCHEDULER_DATA_BASEDIR_PATH:-"/tmp/dolphinscheduler"}
|
2020-07-16 16:36:29 +08:00
|
|
|
export DOLPHINSCHEDULER_OPTS=${DOLPHINSCHEDULER_OPTS:-""}
|
2021-02-14 17:42:04 +08:00
|
|
|
export RESOURCE_STORAGE_TYPE=${RESOURCE_STORAGE_TYPE:-"HDFS"}
|
|
|
|
export RESOURCE_UPLOAD_PATH=${RESOURCE_UPLOAD_PATH:-"/dolphinscheduler"}
|
|
|
|
export FS_DEFAULT_FS=${FS_DEFAULT_FS:-"file:///"}
|
2020-07-16 16:36:29 +08:00
|
|
|
export FS_S3A_ENDPOINT=${FS_S3A_ENDPOINT:-"s3.xxx.amazonaws.com"}
|
|
|
|
export FS_S3A_ACCESS_KEY=${FS_S3A_ACCESS_KEY:-"xxxxxxx"}
|
|
|
|
export FS_S3A_SECRET_KEY=${FS_S3A_SECRET_KEY:-"xxxxxxx"}
|
2020-02-20 20:49:38 +08:00
|
|
|
|
|
|
|
#============================================================================
|
|
|
|
# Zookeeper
|
|
|
|
#============================================================================
|
|
|
|
export ZOOKEEPER_QUORUM=${ZOOKEEPER_QUORUM:-"127.0.0.1:2181"}
|
2020-07-16 16:36:29 +08:00
|
|
|
export ZOOKEEPER_ROOT=${ZOOKEEPER_ROOT:-"/dolphinscheduler"}
|
2020-02-20 20:49:38 +08:00
|
|
|
|
|
|
|
#============================================================================
|
|
|
|
# Master Server
|
|
|
|
#============================================================================
|
|
|
|
export MASTER_EXEC_THREADS=${MASTER_EXEC_THREADS:-"100"}
|
|
|
|
export MASTER_EXEC_TASK_NUM=${MASTER_EXEC_TASK_NUM:-"20"}
|
|
|
|
export MASTER_HEARTBEAT_INTERVAL=${MASTER_HEARTBEAT_INTERVAL:-"10"}
|
|
|
|
export MASTER_TASK_COMMIT_RETRYTIMES=${MASTER_TASK_COMMIT_RETRYTIMES:-"5"}
|
|
|
|
export MASTER_TASK_COMMIT_INTERVAL=${MASTER_TASK_COMMIT_INTERVAL:-"1000"}
|
|
|
|
export MASTER_MAX_CPULOAD_AVG=${MASTER_MAX_CPULOAD_AVG:-"100"}
|
|
|
|
export MASTER_RESERVED_MEMORY=${MASTER_RESERVED_MEMORY:-"0.1"}
|
2020-04-09 11:22:47 +08:00
|
|
|
export MASTER_LISTEN_PORT=${MASTER_LISTEN_PORT:-"5678"}
|
2020-02-20 20:49:38 +08:00
|
|
|
|
|
|
|
#============================================================================
|
|
|
|
# Worker Server
|
|
|
|
#============================================================================
|
|
|
|
export WORKER_EXEC_THREADS=${WORKER_EXEC_THREADS:-"100"}
|
|
|
|
export WORKER_HEARTBEAT_INTERVAL=${WORKER_HEARTBEAT_INTERVAL:-"10"}
|
|
|
|
export WORKER_MAX_CPULOAD_AVG=${WORKER_MAX_CPULOAD_AVG:-"100"}
|
|
|
|
export WORKER_RESERVED_MEMORY=${WORKER_RESERVED_MEMORY:-"0.1"}
|
2020-04-09 11:22:47 +08:00
|
|
|
export WORKER_LISTEN_PORT=${WORKER_LISTEN_PORT:-"1234"}
|
2021-02-25 22:44:06 +08:00
|
|
|
export WORKER_GROUPS=${WORKER_GROUPS:-"default"}
|
2020-08-10 19:05:21 +08:00
|
|
|
export WORKER_WEIGHT=${WORKER_WEIGHT:-"100"}
|
2021-02-23 14:47:10 +08:00
|
|
|
export ALERT_LISTEN_HOST=${ALERT_LISTEN_HOST:-"127.0.0.1"}
|
2020-02-20 20:49:38 +08:00
|
|
|
|
|
|
|
#============================================================================
|
|
|
|
# Alert Server
|
|
|
|
#============================================================================
|
2021-02-23 14:47:10 +08:00
|
|
|
export ALERT_PLUGIN_DIR=${ALERT_PLUGIN_DIR:-"lib/plugin/alert"}
|
2020-02-20 20:49:38 +08:00
|
|
|
|
|
|
|
echo "generate app config"
|
2021-02-26 20:28:56 +08:00
|
|
|
find ${DOLPHINSCHEDULER_HOME}/conf/ -name "*.tpl" | while read file; do
|
2020-02-20 20:49:38 +08:00
|
|
|
eval "cat << EOF
|
2021-02-26 20:28:56 +08:00
|
|
|
$(cat ${file})
|
2020-02-20 20:49:38 +08:00
|
|
|
EOF
|
2021-02-26 20:28:56 +08:00
|
|
|
" > ${file%.*}
|
2020-02-20 20:49:38 +08:00
|
|
|
done
|
2021-02-26 20:28:56 +08:00
|
|
|
find ${DOLPHINSCHEDULER_HOME}/conf/ -name "*.sh" -exec chmod +x {} \;
|