kopia lustrzana https://github.com/kartoza/docker-postgis
rodzic
9f8f979b6e
commit
6eb1043519
|
@ -355,6 +355,10 @@ if [ -z "${TIMESCALE_TUNING_PARAMS}" ]; then
|
|||
TIMESCALE_TUNING_PARAMS=
|
||||
fi
|
||||
|
||||
if [ -z "${TIMESCALE_TUNING_CONFIG}" ]; then
|
||||
TIMESCALE_TUNING_CONFIG=time_scale_tuning.conf
|
||||
fi
|
||||
|
||||
if [ -z "${RUN_AS_ROOT}" ]; then
|
||||
RUN_AS_ROOT=true
|
||||
fi
|
||||
|
@ -507,6 +511,7 @@ function over_write_conf() {
|
|||
cat "${ROOT_CONF}"/extra.conf >> "${ROOT_CONF}"/postgresql.conf
|
||||
fi
|
||||
|
||||
|
||||
}
|
||||
|
||||
function extension_install() {
|
||||
|
|
|
@ -98,20 +98,22 @@ if [[ ! -f ${ROOT_CONF}/extra.conf ]]; then
|
|||
|
||||
fi
|
||||
|
||||
|
||||
|
||||
# Timescale default tuning
|
||||
# TODO If timescale DB accepts reading from include directory then refactor code to remove line 97 - 112 (https://github.com/timescale/timescaledb-tune/issues/80)
|
||||
if [[ $(dpkg -l | grep "timescaledb") > /dev/null ]] && [[ ${ACCEPT_TIMESCALE_TUNING} =~ [Tt][Rr][Uu][Ee] ]] ;then
|
||||
# copy default conf as a backup
|
||||
cp "${ROOT_CONF}"/postgresql.conf "${ROOT_CONF}"/postgresql_orig.conf
|
||||
over_write_conf
|
||||
echo -e "\e[1;31m Time scale config tuning values below"
|
||||
# TODO Add logic to find defaults memory, CPUS as these can vary from defaults on host machine and in docker container
|
||||
timescaledb-tune -yes -quiet "${TIMESCALE_TUNING_PARAMS}" --conf-path="${ROOT_CONF}"/postgresql.conf
|
||||
echo -e "\033[0m Time scale config tuning values set in ${ROOT_CONF}/postgresql.conf"
|
||||
elif [[ ${ACCEPT_TIMESCALE_TUNING} =~ [Tt][Rr][Uu][Ee] ]]; then
|
||||
|
||||
echo -e "\e[1;31m Time scale config tuning values below"
|
||||
timescaledb-tune -yes -quiet "${TIMESCALE_TUNING_PARAMS}" --conf-path="${ROOT_CONF}"/time_scale_tuning.conf
|
||||
echo -e "\033[0m Time scale config tuning values set in ${ROOT_CONF}/time_scale_tuning.conf"
|
||||
|
||||
timescaledb-tune -yes -quiet "${TIMESCALE_TUNING_PARAMS}" --dry-run >"${ROOT_CONF}"/${TIMESCALE_TUNING_CONFIG}
|
||||
if [[ -f "${ROOT_CONF}"/${TIMESCALE_TUNING_CONFIG} ]]; then
|
||||
mv "${ROOT_CONF}"/postgresql_orig.conf $CONF
|
||||
echo "include '${TIMESCALE_TUNING_CONFIG}'" >> $CONF
|
||||
fi
|
||||
echo -e "\033[0m Time scale config tuning values set in ${ROOT_CONF}/${TIMESCALE_TUNING_CONFIG}"
|
||||
fi
|
||||
|
||||
|
||||
|
|
Ładowanie…
Reference in New Issue