安装Presto
将安装包解压缩到/opt/module目录下
[hadoop@hadoop1 soft]$ tar -zxvf presto-server-0.196.tar.gz -C /opt/module
为方便使用,将presto-server-0.196目录名称修改为presto
[hadoop@hadoop1 ~]$ mv /opt/module/presto-server-0.196/ /opt/module/presto
创建data目录
[hadoop@hadoop1 ~]$ mkdir /opt/module/presto/data
创建etc目录
[hadoop@hadoop1 ~]$ mkdir /opt/module/presto/etc
在etc目录下创建jvm.config文件,配置jvm相关的参数信息
[hadoop@hadoop1 ~]$ vim /opt/module/presto/etc/jvm.config
-server
-Xmx16G
-XX:+UseG1GC
-XX:G1HeapRegionSize=32M
-XX:+UseGCOverheadLimit
-XX:+ExplicitGCInvokesConcurrent
-XX:+HeapDumpOnOutOfMemoryError
-XX:+ExitOnOutOfMemoryError
在etc目录下创建catalog目录
创建hive.propertis配置hive相关的参数
[hadoop@hadoop1 ~]$ mkdir /opt/module/presto/etc/catalog
[hadoop@hadoop1 ~]$ vim /opt/module/presto/etc/catalog/hive.properties
connector.name=hive-hadoop2
hive.metastore.uri=thrift://hadoop1:9083
将presto安装文件分发到其他节点
[hadoop@hadoop1 ~]$ xrsync.sh /opt/module/presto
修改3个节点的配置信息 注意node.id使用不同的值
[hadoop@hadoop1 ~]$ vim /opt/module/presto/etc/node.properties
node.environment=production
node.id=ffffffff-ffff-ffff-ffff-ffffffffffff
node.data-dir=/opt/module/presto/data
[hadoop@hadoop2 ~]$ vim /opt/module/presto/etc/node.properties
node.environment=production
node.id=ffffffff-ffff-ffff-ffff-fffffffffffe
node.data-dir=/opt/module/presto/data
[hadoop@hadoop3 ~]$ vim /opt/module/presto/etc/node.properties
node.environment=production
node.id=ffffffff-ffff-ffff-ffff-fffffffffffd
node.data-dir=/opt/module/presto/data
在etc下面创建config.properties文件
[hadoop@hadoop1 ~]$ vim /opt/module/presto/etc/config.properties
coordinator=true
node-scheduler.include-coordinator=false
http-server.http.port=8881
query.max-memory=50GB
discovery-server.enabled=true
discovery.uri=http://hadoop1:8881
[hadoop@hadoop2 ~]$ vim /opt/module/presto/etc/config.properties
coordinator=false
http-server.http.port=8881
query.max-memory=50GB
discovery.uri=http://hadoop1:8881
[hadoop@hadoop3 ~]$ vim /opt/module/presto/etc/config.properties
coordinator=false
http-server.http.port=8881
query.max-memory=50GB
discovery.uri=http://hadoop1:8881
启动MySQL
启动Hive进行测试
[hadoop@hadoop1 soft]$ cd /opt/module/hive
[hadoop@hadoop1 hive]$ ./bin/hive --service metastore >/dev/null 2>&1 &
后台启动presto
[hadoop@hadoop1 presto]$ bin/launcher start
[hadoop@hadoop2 presto]$ bin/launcher start
[hadoop@hadoop3 presto]$ bin/launcher start
安装Presto 客户端
presto-cli-0.196-executable.jar保存到/opt/module/presto目录下,并修改为presto-cli
[hadoop@hadoop1 soft]$ cp /opt/soft/presto-cli-0.196-executable.jar /opt/module/presto/
[hadoop@hadoop1 soft]$ mv /opt/module/presto/presto-cli-0.196-executable.jar /opt/module/presto/presto-cli
[hadoop@hadoop1 soft]$ cd /opt/module/presto
为presto-cli增加执行权限
[hadoop@hadoop1 presto]$ sudo chmod +x presto-cli
启动客户端,执行SQL进行测试
[hadoop@hadoop1 presto]$ ./presto-cli --server hadoop1:8881 --catalog hive --schema default
presto:default>
presto:default> select * from schema.table limit 10;
Query 20210407_145127_00003_3eims failed: line 1:21: mismatched input '.' expecting {
安装Presto Web端查询工具
解压缩yanagishima-18.0.zip
[hadoop@hadoop1 presto]$ cp /opt/soft/yanagishima-18.0.zip /opt/module/presto/
[hadoop@hadoop1 presto]$ unzip yanagishima-18.0.zip
[hadoop@hadoop1 presto]$ cd yanagishima-18.0
[hadoop@hadoop1 yanagishima-18.0] cd conf
配置yanagishima.properties
[hadoop@hadoop1 conf]$ vim yanagishima.properties
# Web端口号
jetty.port=7080
presto.datasources=hadoop-presto
# presto server地址
presto.coordinator.server.hadoop-presto=http://hadoop1:8881
catalog.hadoop-presto=hive
schema.hadoop-presto=default
sql.query.engines=presto



