准备:
【因在官网下载较慢,这里附上微云下载地址:Presto 0.232】
CentOS 7
MySQL 5.7
下载Presto
wget https://repo1.maven.org/maven2/com/facebook/presto/presto-server/0.232/presto-server-0.232.tar.gz
tar -zxvf presto-server-0.232.tar.gz
cd presto-server-0.232
配置Presto
#创建配置文件目录
mkdir etc
cd etc
vim node.properties
node.environment=production
node.id=ffffffff-ffff-ffff-ffff-ffffffffffff
node.data-dir=/var/presto/data
vim jvm.config
-server
-Xmx16G
-XX:+UseG1GC
-XX:G1HeapRegionSize=32M
-XX:+UseGCOverheadLimit
-XX:+ExplicitGCInvokesConcurrent
-XX:+HeapDumpOnOutOfMemoryError
-XX:+ExitOnOutOfMemoryError
vim config.properties
coordinator=true
node-scheduler.include-coordinator=false
http-server.http.port=8020
query.max-memory=50GB
query.max-memory-per-node=1GB
query.max-total-memory-per-node=2GB
discovery-server.enabled=true
discovery.uri=http://example.net:8020
vim log.properties
com.facebook.presto=INFO
创建数据源配置文件目录
mkdir catalog
cd catalog
vim mysql.properties
connector.name=mysql
connection-url=jdbc:mysql://example.net:3306
connection-user=root
connection-password=secret
回到目录,启动Presto
cd ../../
./bin/launcher start
#输出此数据为启动成功
Started as 38017
#Presto关闭
./bin/launcher start
设置Presto-CLI
#下载presto-cli-0.232-executable.jar
wget https://repo1.maven.org/maven2/com/facebook/presto/presto-cli/0.232/presto-cli-0.232-executable.jar
mv presto-cli-0.232-executable.jar presto
#给Presto-CLI可执行权限
chmod +x presto
./presto --server 127.0.0.1:8020 --catalog mysql
#输出结果
presto> use wu_han
末尾:
到此,Presto基本配置完成