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

[bitnami][clickhouse] Fix ClickHouse bug on custom init/start script #72646

Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -80,16 +80,16 @@ clickhouse_copy_mounted_configuration() {
info "Copying mounted configuration from $CLICKHOUSE_MOUNTED_CONF_DIR"
# Copy first the files at the base of the mounted folder to go to ClickHouse
# base etc folder
find "$CLICKHOUSE_MOUNTED_CONF_DIR" -maxdepth 1 \( -type f -o -type l \) -exec cp -L {} "$CLICKHOUSE_CONF_DIR" \;
find "$CLICKHOUSE_MOUNTED_CONF_DIR" -maxdepth 1 \( -type f -o -type l \) -exec cp -L -r {} "$CLICKHOUSE_CONF_DIR" \;

# The ClickHouse override directories (etc/conf.d and etc/users.d) do not support subfolders. That means we cannot
# copy directly with cp -RL because we need all override xml files to have at the root of these subfolders. In the helm
# chart we want to allow overrides from different ConfigMaps and Secrets so we need to use the find command
if [[ -d "${CLICKHOUSE_MOUNTED_CONF_DIR}/conf.d" ]]; then
find "${CLICKHOUSE_MOUNTED_CONF_DIR}/conf.d" \( -type f -o -type l \) -exec cp -L {} "${CLICKHOUSE_CONF_DIR}/conf.d" \;
find "${CLICKHOUSE_MOUNTED_CONF_DIR}/conf.d" \( -type f -o -type l \) -exec cp -L -r {} "${CLICKHOUSE_CONF_DIR}/conf.d" \;
fi
if [[ -d "${CLICKHOUSE_MOUNTED_CONF_DIR}/users.d" ]]; then
find "${CLICKHOUSE_MOUNTED_CONF_DIR}/users.d" \( -type f -o -type l \) -exec cp -L {} "${CLICKHOUSE_CONF_DIR}/users.d" \;
find "${CLICKHOUSE_MOUNTED_CONF_DIR}/users.d" \( -type f -o -type l \) -exec cp -L -r {} "${CLICKHOUSE_CONF_DIR}/users.d" \;
fi
fi
else
Expand Down Expand Up @@ -233,7 +233,7 @@ clickhouse_start_bg() {
is_clickhouse_running && return
# This function is meant to be called for internal operations like the init scripts
local -r cmd=("${CLICKHOUSE_BASE_DIR}/bin/clickhouse-server")
local -r args=("--config-file=${CLICKHOUSE_CONF_FILE}" "--pid-file=${CLICKHOUSE_PID_FILE}" "--" "--listen_host=127.0.0.1")
local -r args=("--config-file=${CLICKHOUSE_CONF_FILE}" "--pid-file=${CLICKHOUSE_PID_FILE}" "--" "--listen_host=0.0.0.0")
dgomezleon marked this conversation as resolved.
Show resolved Hide resolved
if am_i_root; then
run_as_user "$CLICKHOUSE_DAEMON_USER" "${cmd[@]}" "${args[@]}" >"$log_file" 2>&1 &
else
Expand Down
Loading