Presto安装教程
一、Presto Server安装
1)下载地址
https://repo1.maven.org/maven2/com/facebook/presto/presto-server/0.196/presto-server-0.196.tar.gz
2)将presto-server-0.196.tar.gz通过XFTP导入到hadoop102的/opt/software目录下,并解压到/opt/software目录
tar -zxvf presto-server-0.196.tar.gz -C /opt/module/
3)修改名称为presto
mv presto-server-0.196/ presto
4)进入到/opt/module/presto目录,并创建存储配置文件文件夹
mkdir data
5)进入到/opt/module/presto目录,并创建存储配置文件文件夹
mkdir etc
6)配置在/opt/module/presto/etc目录下添加jvm.config配置文件
vim jvm.config
-server
-Xmx16G
-XX:+UseG1GC
-XX:G1HeapRegionSize=32M
-XX:+UseGCOverheadLimit
-XX:+ExplicitGCInvokesConcurrent
-XX:+HeapDumpOnOutOfMemoryError
-XX:+ExitOnOutOfMemoryError
7)Presto可以支持多个数据源,在Presto里面叫catalog,这里我们配置支持Hive的数据源,配置一个Hive的catalog
mkdir catalog
vim hive.properties
添加如下的内容:
connector.name=hive-hadoop2
hive.metastore.uri=thrift://hadoop102:9083
将hadoop102上的presto分发到hadoop103、hadoop104
xsync presto
9)解压之后,分别进入hadoop102、hadoop103、hadoop104三台主机的/opt/module/presto/etc的路径。配置node属性,node id每个节点都不一样。
node.id,结尾分别是 ff fe fd
[root@hadoop102 etc]$vim node.properties
node.environment=production
node.id=ffffffff-ffff-ffff-ffff-ffffffffffff
node.data-dir=/opt/module/presto/data
[root@hadoop103 etc]$vim node.properties
node.environment=production
node.id=ffffffff-ffff-ffff-ffff-fffffffffffe
node.data-dir=/opt/module/presto/data
[root@hadoop104 etc]$vim node.properties
node.environment=production
node.id=ffffffff-ffff-ffff-ffff-fffffffffffd
node.data-dir=/opt/module/presto/data
10)Presto是由一个coordinator节点和多个worker节点组成。在hadoop102上配置成coordinator,在hadoop103、hadoop104上配置为worker。
(1)hadoop102上配置coordinator节点
[root@hadoop102 etc]$ vim 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://hadoop102:8881
(2)hadoop103、hadoop104上配置worker节点
[root@hadoop103 etc]$ vim config.properties
添加内容如下
coordinator=false
http-server.http.port=8881
query.max-memory=50GB
discovery.uri=http://hadoop102:8881
[root@hadoop104 etc]$ vim config.properties
添加如下内容:
coordinator=false
http-server.http.port=8881
query.max-memory=50GB
discovery.uri=http://hadoop102:8881
11)在/opt/module/hive目录下,启动Hive Metastore,用atguigu角色
nohup bin/hive --service metastore >/dev/null 2>&1 &
12)分别在hadoop102、hadoop103、hadoop104上启动presto server
(1)前台启动presto,控制台显示日志
[atguigu@hadoop102 presto]$ bin/launcher run
[atguigu@hadoop103 presto]$ bin/launcher run
[atguigu@hadoop104 presto]$ bin/launcher run
(2)后台启动presto
[atguigu@hadoop102 presto]$ bin/launcher start
[atguigu@hadoop103 presto]$ bin/launcher start
[atguigu@hadoop104 presto]$ bin/launcher start
二、Presto可视化Client安装
1)将yanagishima-18.0.zip上传到hadoop102的/opt/module目录
2)解压缩yanagishima
[root@hadoop102 module]$ unzip yanagishima-18.0.zip
cd yanagishima-18.0
3)进入到/opt/module/yanagishima-18.0/conf文件夹,编写yanagishima.properties配置
vim yanagishima.properties
添加如下内容
jetty.port=7080
presto.datasources=atiguigu-presto
presto.coordinator.server.atiguigu-presto=http://hadoop102:8881
catalog.atiguigu-presto=hive
schema.atiguigu-presto=default
sql.query.engines=presto
4)在/opt/module/yanagishima-18.0路径下启动yanagishima
[root@hadoop102 yanagishima-18.0]$
nohup bin/yanagishima-start.sh >y.log 2>&1 &
5)启动web页面
http://hadoop102:7080
看到界面,进行查询了。