presto安装

wget https://repo1.maven.org/maven2/com/facebook/presto/presto-server/0.196/presto-server-0.19 6.tar.gz 

将 presto-server-0.196.tar.gz 导入 hadoop102 的/opt/software 目录下,并解压到/opt/module目录 ,修改名称为 presto 

进入到/opt/module/presto 目录,并创建存储数据文件夹 

 mkdir data
 mkdir etc

配置在/opt/module/presto/etc 目录下添加 jvm.config 配置文件

添加如下内容 

-server 
-Xmx16G 
-XX:+UseG1GC 
-XX:G1HeapRegionSize=32M 
-XX:+UseGCOverheadLimit 
-XX:+ExplicitGCInvokesConcurrent 
-XX:+HeapDumpOnOutOfMemoryError 
-XX:+ExitOnOutOfMemoryError 

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

分发之后,分别进入 hadoop102、hadoop103、hadoop104 三台主机的/opt/module/presto/etc 的路径。配置 node 属性,nodeid 每个节点都不一样。 

[atguigu@hadoop102 etc]$vim node.properties 
node.environment=production 
node.id=ffffffff-ffff-ffff-ffff-ffffffffffff
node.data-dir=/opt/module/presto/data 

[atguigu@hadoop103 etc]$vim node.properties 
node.environment=production 
node.id=ffffffff-ffff-ffff-ffff-fffffffffffe 
node.data-dir=/opt/module/presto/data 

[atguigu@hadoop104 etc]$vim node.properties 
node.environment=production 
node.id=ffffffff-ffff-ffff-ffff-fffffffffffd 
node.data-dir=/opt/module/presto/data 

Presto 是由一个 coordinator 节点和多个 worker 节点组成。在 hadoop102 上配置成 coordinator,在 hadoop103、hadoop104 上配置为 worker。 

hadoop102 上配置 coordinator 节点 

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 

hadoop103、hadoop104 上配置 worker 节点

vim config.properties 

添加内容如下 

coordinator=false 
http-server.http.port=8881 
query.max-memory=50GB 
discovery.uri=http://hadoop102:8881

 

hadoop104 上配置 worker 节点

vim config.properties 

添加内容如下 

coordinator=false 
http-server.http.port=8881 
query.max-memory=50GB 
discovery.uri=http://hadoop102:8881

在 hadoop102 的/opt/module/hive 目录下,启动 HiveMetastore

前台启动:

hive --service metastore

后台启动:

nohup bin/hive --service metastore >/dev/null 2>&1 & 

分别在 hadoop102、hadoop103、hadoop104 上启动 PrestoServer 

前台启动 Presto,控制台显示日志 

bin/launcher run 

后台启动 Presto 

 bin/launcher start 

日志查看路径: /opt/module/presto/data/var/log

 

Presto 命令行 Client 安装


1)下载 Presto 的客户端 https://repo1.maven.org/maven2/com/facebook/presto/presto-cli/0.196/presto-cli-0.196-execu table.jar 2)将 presto-cli-0.196-executable.jar 上传到 hadoop102 的/opt/module/presto 文件夹下

3)修改文件名称

mv presto-cli-0.196-executable.jar prestocli 

4)增加执行权限

chmod +x prestocli 

5)启动

./prestocli --server hadoop102:8881 --catalog hive --schema default

6)Presto 命令行操作

Presto 的命令行操作,相当于 Hive 命令行操作。每个表必须要加上 schema。

例如: select * from schema.table limit 100 

Presto 可视化 Client 安装

1)将 yanagishima-18.0.zip 上传到 hadoop102 的/opt/module 目录

2)解压缩 yanagishima

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=atguigu-presto 
presto.coordinator.server.atguigu-presto=http://hadoop102:8881 
catalog.atguigu-presto=hive 
schema.atguigu-presto=default 
sql.query.engines=presto 

4)在/opt/module/yanagishima-18.0 路径下启动 yanagishima

nohup bin/yanagishima-start.sh >y.log 2>&1 & 

5)启动 web 页面 http://hadoop102:7080/ 看到界面,进行查询了。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值