栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 前沿技术 > 大数据 > 大数据系统

Presto0.196的下载及安装

Presto0.196的下载及安装

Presto的下载及安装 一、简介 (1)优点:

1、基于内存计算,减少了磁盘IO,计算快;

2、能够连接多数据源

3、Impala性能稍领先于Presto,但是Presto在数据源支持上非常丰富,包括Hive、图数据库、传统关系型数据库、Redis等。

(2)缺点

能处理PB级别的数据,但是并不是把所有数据都放入内存中计算。简单的聚合是边读数据边计算,再清内存,再读数据再计算,这种消耗内存并不高。

连表查询,会产生大量临时数据,速度就会慢。

二、架构图

三、下载及安装 (1)Presto Server安装

1)下载地址

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

2)上传、解压

tar -zxvf  ./presto-server-0.196.tar.gz -C /opt/apps/presto/ 
  1. 进入presto-server-0.196
# 创建文件夹

# 存储数据文件夹
[root@centos01 presto-server-0.196]# mkdir data
# 配置文件文件夹
[root@centos01 presto-server-0.196]# mkdir etc
# 在/etc下添加文件
[root@centos01 etc]# vim jvm.config
# 文件内容
-server
-Xmx16G
-XX:+UseG1GC
-XX:G1HeapRegionSize=32M
-XX:+UseGCOverheadLimit
-XX:+ExplicitGCInvokesConcurrent
-XX:+HeapDumponOutOfMemoryError
-XX:+ExitonOutOfMemoryError

4)Presto可以支持多个数据源,在Presto里面叫catalog,这里我们配置支持Hive的数据源,配置一个Hive的catalog

[root@centos01 etc]# mkdir catalog

# 进入catalog 
[root@centos01 etc]# cd catalog/
[root@centos01 catalog]# vim hive.properties

# 添加内容
connector.name=hive-hadoop2
hive.metastore.uri=thrift://centos01:9083
  1. 分发
[root@centos01 apps]# scp -r ./presto/ centos02:/opt/apps/
[root@centos01 apps]# scp -r ./presto/ centos03:/opt/apps/
  1. 分发之后,分别进入这三台主机的etc的路径。配置node属性,node id每个节点都不一样。
[root@centos01 etc]# pwd
/opt/apps/presto/presto-server-0.196/etc
[root@centos01 etc]# ll
total 4
drwxr-xr-x. 2 root root  29 Nov 17 20:49 catalog
-rw-r--r--. 1 root root 171 Nov 17 20:52 jvm.config


[root@centos01 etc]# vim node.properties
node.environment=production
node.id=ffffffff-ffff-ffff-ffff-fffffffffffe
node.data-dir=/opt/apps/presto/presto-server-0.196/data

[root@centos02 etc]# vim node.properties
node.environment=production
node.id=ffffffff-ffff-ffff-ffff-ffffffffffff
node.data-dir=/opt/apps/presto/presto-server-0.196/data

[root@centos03 etc]# vim node.properties
node.environment=production
node.id=ffffffff-ffff-ffff-ffff-fffffffffffg
node.data-dir=/opt/apps/presto/presto-server-0.196/data

  1. Presto是由一个coordinator节点和多个worker节点组成。在centos01上配置成coordinator,在centos02、centos03上配置为worker。
# 在centos01上配置成coordinator
[root@centos01 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://centos01:8881

# 在centos02、centos03上配置为worker
[root@centos02 etc]# vim config.properties
coordinator=false
http-server.http.port=8881
query.max-memory=50GB
discovery.uri=http://centos01:8881

[root@centos03 etc]# vim config.properties
coordinator=false
http-server.http.port=8881
query.max-memory=50GB
discovery.uri=http://centos01:8881
  1. 启动Hive metastore
nohup hive --service metastore >/dev/null 2>&1 &
  1. 分别在三台机器上启动Presto Server

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

[root@centos01 presto-server-0.196]# ./bin/launcher run
[root@centos02 presto-server-0.196]# ./bin/launcher run
[root@centos03 presto-server-0.196]# ./bin/launcher run

(2)后台启动Presto

[root@centos01 presto-server-0.196]# ./bin/launcher start
[root@centos02 presto-server-0.196]# ./bin/launcher start
[root@centos03 presto-server-0.196]# ./bin/launcher start
(2) Presto命令行Client安装

客户端的下载地址:

https://repo1.maven.org/maven2/com/facebook/presto/presto-cli/0.196/presto-cli-0.196-executable.jar

将presto-cli-0.196-executable.jar上传到centos01的/opt/apps/presto文件夹下

# 改名
[root@centos01 presto]# mv  presto-cli-0.196-executable.jar  prestocli

# 增加执行权限
[root@centos01 presto]# chmod +x prestocli

# 启动
[root@centos01 presto]# ./prestocli --server centos01:8881 --catalog hive --schema default

# 执行命令
presto:default> show schemas;
presto:default> use ods;
USE
presto:ods> show tables;
     Table     
---------------
 app_event_log 
# 注意:每个表必须要加上schema(即数据库名称)
presto:ods> select * from ods.app_event_log t limit 10;
(3)Presto可视化Client安装
# 解压
[root@centos01 presto]# unzip yanagishima-18.0.zip
[root@centos01 presto]# cd yanagishima-18.0/

# 编写yanagishima.properties配置
[root@centos01 conf]# vim yanagishima.properties

# 添加下面的内容,注意是添加
jetty.port=7080
presto.datasources=yyds-presto
presto.coordinator.server.yyds-presto=http://centos01:8881
catalog.yyds-presto=hive
schema.yyds-presto=default
sql.query.engines=presto

# 启动
[root@centos01 yanagishima-18.0]# nohup bin/yanagishima-start.sh >y.log 2>&1 &

前端页面:

http://192.168.42.101:7080

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/584685.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号