This is a blank presto single server/laptop template using presto version 0.229 Sensitive Catalog/Connection credentials have been replaced with empty strings.
- Presto has a few basic requirements:
- Linux or Mac OS X
- Java 8, 64-bit -- this one was the trickiest req for me
sudo apt install openjdk-8-jdk openjdk-8-jre
- Python 2.4+
- Requirements above
- Visit https://prestodb.io/download.html and download
presto-server-0.229.tar.gz
or latest version. - Extract the
presto-server-0.229.tar.gz
gzip file and move to a directory. You can delete the original gzip file after extrtacting.
- This guide will depend on moving the extracted directory into the
~/presto/presto-server-0.229/
location
- Download this repository
git clone [email protected]:angelddaz/presto_template.git /tmp/presto
- Move /etc/ from this repository into your presto-server folder.
mv /tmp/presto/etc ~/presto/presto-server-0.229/
- Change 'angel' in
node.data-dir=/home/angel/presto/presto-server-0.229/data
to your presto server data dir in the following file
/presto-server-0.229/etc/node.properties : line 3
- Run presto in the background from any directory in the command line with the following command
~/presto/presto-server-0.229/bin/launcher start
- Visit http://localhost:8080/ in your browser will show you a UI for presto
- Kill presto with
~/presto/presto-server-0.229/bin/launcher kill
- Complete
Deploying Single Presto Server section
- Run
pip install -r /tmp/presto/requirements.txt
from the repository download above if you haven't yet. - The following bash command will run presto in port 8080
~/presto/presto-server-0.229/bin/launcher run
- Move the template jupyter notebook from the temporary repository location and run it locally with the following commands
mv ~/tmp/presto/cross-db-template.ipynb ~/presto/
jupyter notebook ~/presto/cross-db-template.ipynb &
- visiting
http://localhost:8888/
in your browser will show you a UI for Jupyter
- Requirements specified above Single Presto Server installation
- Visit https://prestodb.io/download.html and download
presto-cli-0.229-executable.jar
- Move this jar file into the home presto location while renaming it to
presto-cli
mv ~/Downloads/presto-cli-0.229-executable.jar ~/presto/presto-cli
- Make this jar file executable
chmod +x ~/presto/presto-cli
- Run from any directory in the command line with the following command
~/presto/presto-cli
- Check if it is running with following CLI command
SHOW CATALOGS
- Kill with
exit
Four Configuration files are held in the /etc which does not include the catalog directory which make presto work on a single computer or instance.
- config.properties
- jvm.config
- log.properties
- node.properties
Database connections are named Catalogs in Presto.
There are two catalog templates included in this template; MySQL and Postgres.
They can be found in etc/catalog
directory
There is a single jupyter notebook file in this repository which has all python code needed for a cross database join.