Presto安裝
前提條件: hadoop安裝好了(並啟動了) + hive安裝好了
首先解壓下載好的tar.gz包
1 .安裝包
https://repo1.maven.org/maven2/com/facebook/presto/presto-server/0.100/presto-server-0.100.tar.gz
2. 客戶端連接包下載:
https://repo1.maven.org/maven2/com/facebook/presto/presto-cli/0.100/presto-cli-0.100-executable.jar
解壓
presto-server-0.100.tar.gz 然后進入創建etc文件夾,新建下面文件夾和文件

hadoop文件夾: hadoop的配置文件:hdfs-site.xml core-site.xml
node.properties:每個節點的環境配置
jvm.config:jvm 參數
config.properties:配置 Presto Server 參數
log.properties:配置日志等級
Catalog :Catalog 文件夾,下面放各個數據的配置文件比如hive.properties
1>node.properties配置
node.environment=production
node.id=1
node.data-dir=/home/kevin/software/presto-server-0.100/data
節點配置node.id=1
切記:每個節點不能重復我本地把協調和生產節點部署到了一起
2>config.properties
coordinator=true
node-scheduler.include-coordinator=true
http-server.http.port=8080
task.max-memory=1GB
discovery-server.enabled=true
discovery.uri=http://192.168.43.20:8080
3>catalog /hive.properties的配置

connector.name是連接器,我是apache2*版本的,所以我用hive-hadoop2
connector.name=hive-hadoop2
hive.metastore.uri=thrift://192.168.43.20:9083
hive.config.resources=/home/kevin/software/presto-server-0.100/etc/hadoop/core-site.xml,/home/kevin/software/presto-server-0.100/etc/hadoop/hdfs-site.xml
4>jvm.config配置
-server
-Xmx16G
-XX:+UseConcMarkSweepGC
-XX:+ExplicitGCInvokesConcurrent
-XX:+CMSClassUnloadingEnabled
-XX:+AggressiveOpts
-XX:+HeapDumpOnOutOfMemoryError
-XX:OnOutOfMemoryError=kill -9 %p
-XX:ReservedCodeCacheSize=150M
這個可以根據自己的機器配置進行相應調整
5>log.properties配置
com.facebook.presto=INFO
配置完成之后,可以運行presto服務了,如果目錄權限不夠,使用如下命令(我自己是kevin)
chown -R kevin:kevin /home/presto
presto服務的啟動方式有兩種,第一種是start后台運行看不到日志輸出 ,run前台運行,可在前台看到打印日志,建議前期使用run進行前台運行


當出現這樣的關鍵詞時,恭喜搭建完成


接下來可以測試一下,我們使用一個工具presto-cli-0.100-executable.jar 下載之后,重命名為presto-cli 並加上權限
mv presto-cli-0.100-executable.jar presto-cli
sudo chmod +x ./presto-cli
啟動Hive服務(如果是后台啟動,后面加上&)


Presto客戶端連接
./presto-cli --server localhost:8080 --catalog hive --schema default

如上命令行,可以執行一下show tables;進行測試