Skip to content

Instantly share code, notes, and snippets.

@frsyuki
Last active June 4, 2020 06:26
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save frsyuki/8001572 to your computer and use it in GitHub Desktop.
Save frsyuki/8001572 to your computer and use it in GitHub Desktop.
#!/bin/bash
#tar czvf config.tar.gz discovery-server presto-coordinator presto-worker
# If you're using Mac OS X, you maybe need to add following entry to /etc/hosts:
# $ echo "127.0.0.1 $(hostname)" >> /etc/hosts
git clone https://github.com/facebook/presto.git
cd presto
git checkout v0.54
##
## Presto requres Java 1.7
##
export JAVA_HOME="$(/usr/libexec/java_home -v 1.7.0)"
##
## Build Presto
##
version="$(xpath pom.xml "/project/version/text()")"
pushd presto-server
mvn package assembly:assembly -DdescriptorId=bin -Dtest=skip -DfailIfNoTests=false
popd
##
## Deploy
##
rm -rf presto-deploy
mkdir -p presto-deploy
pushd presto-deploy
tar zxvf "../presto-server/target/presto-server-$version.tar.gz"
tar zxvf ../../config.tar.gz
cp -a presto-server-$version/* presto-coordinator/
cp -a presto-server-$version/* presto-worker/
rm -rf presto-server-$version
## discovery server
curl "http://search.maven.org/remotecontent?filepath=io/airlift/discovery/discovery-server/1.16/discovery-server-1.16.tar.gz" | tar zxvf -
mv discovery-server-*/* discovery-server/
rm -rf discovery-server-*
popd
##
## CLI
##
curl "http://search.maven.org/remotecontent?filepath=com/facebook/presto/presto-cli/0.54/presto-cli-0.54-executable.jar" -o presto-cli-executable.jar
chmod 755 presto-cli-executable.jar
###
## ./discovery-server/bin/launcher run
## ./presto-coordinator/bin/launcher run
## ./presto-worker/bin/launcher run
##
# java -jar presto-cli-executable.jar --server http://127.0.0.1:8880/ --catalog native --schema default
# > SELECT 1;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment