startup-init-conf.sh 4.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. #!/bin/bash
  2. #
  3. # Licensed to the Apache Software Foundation (ASF) under one or more
  4. # contributor license agreements. See the NOTICE file distributed with
  5. # this work for additional information regarding copyright ownership.
  6. # The ASF licenses this file to You under the Apache License, Version 2.0
  7. # (the "License"); you may not use this file except in compliance with
  8. # the License. You may obtain a copy of the License at
  9. #
  10. # http://www.apache.org/licenses/LICENSE-2.0
  11. #
  12. # Unless required by applicable law or agreed to in writing, software
  13. # distributed under the License is distributed on an "AS IS" BASIS,
  14. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  15. # See the License for the specific language governing permissions and
  16. # limitations under the License.
  17. #
  18. set -e
  19. echo "init env variables"
  20. # Define parameters default value
  21. #============================================================================
  22. # Database Source
  23. #============================================================================
  24. export DATABASE_HOST=${DATABASE_HOST:-"127.0.0.1"}
  25. export DATABASE_PORT=${DATABASE_PORT:-"5432"}
  26. export DATABASE_USERNAME=${DATABASE_USERNAME:-"root"}
  27. export DATABASE_PASSWORD=${DATABASE_PASSWORD:-"root"}
  28. export DATABASE_DATABASE=${DATABASE_DATABASE:-"dolphinscheduler"}
  29. export DATABASE_TYPE=${DATABASE_TYPE:-"postgresql"}
  30. export DATABASE_DRIVER=${DATABASE_DRIVER:-"org.postgresql.Driver"}
  31. export DATABASE_PARAMS=${DATABASE_PARAMS:-"characterEncoding=utf8"}
  32. #============================================================================
  33. # Common
  34. #============================================================================
  35. export DOLPHINSCHEDULER_ENV_PATH=${DOLPHINSCHEDULER_ENV_PATH:-"/opt/dolphinscheduler/conf/env/dolphinscheduler_env.sh"}
  36. export DOLPHINSCHEDULER_DATA_BASEDIR_PATH=${DOLPHINSCHEDULER_DATA_BASEDIR_PATH:-"/tmp/dolphinscheduler"}
  37. export DOLPHINSCHEDULER_OPTS=${DOLPHINSCHEDULER_OPTS:-""}
  38. export RESOURCE_STORAGE_TYPE=${RESOURCE_STORAGE_TYPE:-"HDFS"}
  39. export RESOURCE_UPLOAD_PATH=${RESOURCE_UPLOAD_PATH:-"/dolphinscheduler"}
  40. export FS_DEFAULT_FS=${FS_DEFAULT_FS:-"file:///"}
  41. export FS_S3A_ENDPOINT=${FS_S3A_ENDPOINT:-"s3.xxx.amazonaws.com"}
  42. export FS_S3A_ACCESS_KEY=${FS_S3A_ACCESS_KEY:-"xxxxxxx"}
  43. export FS_S3A_SECRET_KEY=${FS_S3A_SECRET_KEY:-"xxxxxxx"}
  44. #============================================================================
  45. # Zookeeper
  46. #============================================================================
  47. export ZOOKEEPER_QUORUM=${ZOOKEEPER_QUORUM:-"127.0.0.1:2181"}
  48. export ZOOKEEPER_ROOT=${ZOOKEEPER_ROOT:-"/dolphinscheduler"}
  49. #============================================================================
  50. # Master Server
  51. #============================================================================
  52. export MASTER_EXEC_THREADS=${MASTER_EXEC_THREADS:-"100"}
  53. export MASTER_EXEC_TASK_NUM=${MASTER_EXEC_TASK_NUM:-"20"}
  54. export MASTER_HEARTBEAT_INTERVAL=${MASTER_HEARTBEAT_INTERVAL:-"10"}
  55. export MASTER_TASK_COMMIT_RETRYTIMES=${MASTER_TASK_COMMIT_RETRYTIMES:-"5"}
  56. export MASTER_TASK_COMMIT_INTERVAL=${MASTER_TASK_COMMIT_INTERVAL:-"1000"}
  57. export MASTER_MAX_CPULOAD_AVG=${MASTER_MAX_CPULOAD_AVG:-"100"}
  58. export MASTER_RESERVED_MEMORY=${MASTER_RESERVED_MEMORY:-"0.1"}
  59. export MASTER_LISTEN_PORT=${MASTER_LISTEN_PORT:-"5678"}
  60. #============================================================================
  61. # Worker Server
  62. #============================================================================
  63. export WORKER_EXEC_THREADS=${WORKER_EXEC_THREADS:-"100"}
  64. export WORKER_HEARTBEAT_INTERVAL=${WORKER_HEARTBEAT_INTERVAL:-"10"}
  65. export WORKER_MAX_CPULOAD_AVG=${WORKER_MAX_CPULOAD_AVG:-"100"}
  66. export WORKER_RESERVED_MEMORY=${WORKER_RESERVED_MEMORY:-"0.1"}
  67. export WORKER_LISTEN_PORT=${WORKER_LISTEN_PORT:-"1234"}
  68. export WORKER_GROUP=${WORKER_GROUP:-"default"}
  69. export WORKER_WEIGHT=${WORKER_WEIGHT:-"100"}
  70. export ALERT_LISTEN_HOST=${ALERT_LISTEN_HOST:-"127.0.0.1"}
  71. #============================================================================
  72. # Alert Server
  73. #============================================================================
  74. export ALERT_PLUGIN_DIR=${ALERT_PLUGIN_DIR:-"lib/plugin/alert"}
  75. echo "generate app config"
  76. ls ${DOLPHINSCHEDULER_HOME}/conf/ | grep ".tpl" | while read line; do
  77. eval "cat << EOF
  78. $(cat ${DOLPHINSCHEDULER_HOME}/conf/${line})
  79. EOF
  80. " > ${DOLPHINSCHEDULER_HOME}/conf/${line%.*}
  81. done