Presto 0.232配置

試著忘記壹切 提交于 2020-03-17 02:16:02

准备:

Presto官网中下载最新版本

【因在官网下载较慢,这里附上微云下载地址: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基本配置完成

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!