|
15 | 15 | # limitations under the License. |
16 | 16 | # |
17 | 17 |
|
18 | | -CONF_FILE="${FLUSS_HOME}/conf/server.yaml" |
| 18 | +COMMON_CONF_FILE="${FLUSS_HOME}/conf/common.yaml" |
19 | 19 |
|
20 | 20 | prepare_configuration() { |
| 21 | + additional_conf_file="${FLUSS_HOME}/conf/$1" |
| 22 | + |
21 | 23 | if [ -n "${FLUSS_PROPERTIES}" ]; then |
22 | | - echo "${FLUSS_PROPERTIES}" >> "${CONF_FILE}" |
| 24 | + # copy over all configuration options of FLUSS_PROPERTIES to the common and the additional configuration file |
| 25 | + # since we cannot tell which configuration options are specific and which are not |
| 26 | + echo "#==============================================================================" | tee -a "${COMMON_CONF_FILE}" "$additional_conf_file" |
| 27 | + echo "# Configuration Options from FLUSS_PROPERTIES Environment Variable" | tee -a "${COMMON_CONF_FILE}" "$additional_conf_file" |
| 28 | + echo "#==============================================================================" | tee -a "${COMMON_CONF_FILE}" "$additional_conf_file" |
| 29 | + echo "${FLUSS_PROPERTIES}" | tee -a "${COMMON_CONF_FILE}" "$additional_conf_file" |
23 | 30 | fi |
24 | | - envsubst < "${CONF_FILE}" > "${CONF_FILE}.tmp" && mv "${CONF_FILE}.tmp" "${CONF_FILE}" |
| 31 | + envsubst < "${COMMON_CONF_FILE}" > "${COMMON_CONF_FILE}.tmp" && mv "${COMMON_CONF_FILE}.tmp" "${COMMON_CONF_FILE}" |
| 32 | + envsubst < "$additional_conf_file" > "$additional_conf_file.tmp" && mv "$additional_conf_file.tmp" "$additional_conf_file" |
25 | 33 | } |
26 | 34 |
|
27 | | -prepare_configuration |
28 | | - |
29 | 35 | args=("$@") |
30 | 36 |
|
31 | 37 | if [ "$1" = "help" ]; then |
32 | 38 | printf "Usage: $(basename "$0") (coordinatorServer|tabletServer)\n" |
33 | 39 | printf " Or $(basename "$0") help\n\n" |
34 | 40 | exit 0 |
35 | 41 | elif [ "$1" = "coordinatorServer" ]; then |
| 42 | + prepare_configuration "coordinator-server.yaml" |
36 | 43 | args=("${args[@]:1}") |
37 | 44 | echo "Starting Coordinator Server" |
38 | 45 | exec "$FLUSS_HOME/bin/coordinator-server.sh" start-foreground "${args[@]}" |
39 | 46 | elif [ "$1" = "tabletServer" ]; then |
| 47 | + prepare_configuration "tablet-server.yaml" |
40 | 48 | args=("${args[@]:1}") |
41 | 49 | echo "Starting Tablet Server" |
42 | 50 | exec "$FLUSS_HOME/bin/tablet-server.sh" start-foreground "${args[@]}" |
|
0 commit comments