Skip to content

Instantly share code, notes, and snippets.

@Laxman-SM
Forked from agrawalreetika/coordinator_setup.sh
Created February 3, 2020 09:31
Show Gist options
  • Save Laxman-SM/0f6695f49fc17e4f6ad96f33ea2b0077 to your computer and use it in GitHub Desktop.
Save Laxman-SM/0f6695f49fc17e4f6ad96f33ea2b0077 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
#Install presto-cli
cd /usr/lib/
sudo wget https://repo1.maven.org/maven2/io/prestosql/presto-cli/325/presto-cli-325-executable.jar
sudo mv presto-cli-325-executable.jar /usr/bin/presto
sudo chmod 0755 /usr/bin/presto
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment