Skip to content

Instantly share code, notes, and snippets.

@agrawalreetika
Last active March 3, 2020 09:37
Show Gist options
  • Save agrawalreetika/bac5fb05e1f721049789068ea265acfd to your computer and use it in GitHub Desktop.
Save agrawalreetika/bac5fb05e1f721049789068ea265acfd to your computer and use it in GitHub Desktop.
This has all the steps to setup presto coordinator on VM.
# Install wget
sudo yum install -y wget
# Setup Presto
sudo mkdir -m757 -p /var/presto/data
cd /usr/lib/
sudo wget https://repo1.maven.org/maven2/io/prestosql/presto-server/325/presto-server-325.tar.gz
sudo tar xvzf presto-server-325.tar.gz
sudo mv presto-server-325 presto
sudo rm presto-server-325.tar.gz
cd presto
sudo mkdir -p etc/catalog
UUID=`uuidgen`
# jvm.config - command line options for the Java Virtual Machine
echo "-server
-Xmx4G
-XX:-UseBiasedLocking
-XX:+UseG1GC
-XX:G1HeapRegionSize=32M
-XX:+ExplicitGCInvokesConcurrent
-XX:+ExitOnOutOfMemoryError
-XX:+UseGCOverheadLimit
-XX:+HeapDumpOnOutOfMemoryError
-XX:ReservedCodeCacheSize=512M
-Djdk.attach.allowAttachSelf=true
-Djdk.nio.maxCachedBufferSize=2000000" > etc/jvm.config
# log.properties
echo "io.prestosql=INFO" > etc/log.properties
# etc/catalog/jmx.properties - configuration for JMX Connector (data source)
echo "connector.name=jmx" > etc/catalog/jmx.properties
# Setup config.properties - configuration for the Presto server
echo "coordinator=true
node-scheduler.include-coordinator=false
http-server.http.port=8080
query.max-memory=10GB
query.max-memory-per-node=1GB
query.max-total-memory-per-node=2GB
discovery-server.enabled=true
discovery.uri=http://presto-coordinator-vm:8080" > etc/config.properties
# node.properties - environmental configuration specific to each node
echo "node.environment=production
node.id=$UUID
node.data-dir=/var/presto/data" > etc/node.properties
# Lets start presto coordinator
cd /usr/lib/presto
bin/launcher start
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment