Skip to content

Instantly share code, notes, and snippets.

@kokosing
Created January 21, 2019 11:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save kokosing/9b8a0b16398792ad137fe3f5ef8000a9 to your computer and use it in GitHub Desktop.
Save kokosing/9b8a0b16398792ad137fe3f5ef8000a9 to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
set -xeuo pipefail
usage()
{
echo "Usage: $0 -p <path of configs to be overriden>" >&2
exit 1
}
wget -O /tmp/common.sh -q https://prestostoregen1.blob.core.windows.net/override/common.sh
. /tmp/common.sh
rm -f /tmp/common.sh
wget -O /tmp/presto_config_override.py -q https://starburstdata.blob.core.windows.net/presto/presto_config_override.py
declare override_config=""
declare config_dir="/${server_tarball_filename}/etc/"
if [ ! -d "${config_dir}" ]; then
echo "[Error] Presto not installed/configured. You cannot modify configuration before installing Presto. Exiting!" >&2
exit 1
fi
# Initialize parameters specified from command line
while getopts ":p:" arg; do
case "${arg}" in
p)
override_config=${OPTARG}
;;
esac
done
shift $((OPTIND-1))
if [[ -z "$override_config" ]]; then
echo "Parameter override_config is missing." >&2
usage
fi
setup_python36
python3.6 /tmp/presto_config_override.py $config_dir $override_config
rm -f /tmp/presto_config_override.py
if is_presto_node; then
sudo -u presto "${server_tarball_filename}/bin/launcher" restart
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment