本文主要是介绍(43)即席查询(Presto),希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
1.概念
2.架构
3. Presto 优缺点
4.Presto、Impala 性能比较
https://blog.csdn.net/u012551524/article/details/79124532
测试结论: Impala 性能稍领先于 Presto ,但是 Presto 在数据源支持上非常丰富,包括
Hive 、图数据库、传统关系型数据库、 Redis 等。
2 Presto 安装
1.2.1 Presto Server 安装
0 )官网地址
https://prestodb.github.io/
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 导入 hadoop102 的 /opt/software 目录下,并解压到 /opt/module
目录
[atguigu@hadoop102 software]$ tar
-zxvf presto-server-
0.196.tar.gz -C /opt/module/
3 )修改名称为 presto
[atguigu@hadoop102 module]$ mv presto-server-0.196/ presto
4 )进入到 /opt/module/presto 目录,并创建存储数据文件夹
[atguigu@hadoop102 presto]$ mkdir data
5 )进入到 /opt/module/presto 目录,并创建存储配置文件文件夹
[atguigu@hadoop102 presto]$ mkdir etc
6 )配置在 /opt/module/presto/etc 目录下添加 jvm.config 配置文件
[atguigu@hadoop102 etc]$ 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
[atguigu@hadoop102 etc]$ mkdir catalog
[atguigu@hadoop102 catalog]$ vim hive.properties
添加如下内容
connector.name=hive-hadoop2
hive.metastore.uri=thrift://hadoop102:9083
8 )将 hadoop102 上的 presto 分发到 hadoop103 、 hadoop104
[atguigu@hadoop102 module]$ xsync presto
9 )分发之后,分别进入 hadoop102 、 hadoop103 、 hadoop104 三台主机的 /opt/module/presto/etc
的路径。配置 node 属性, node id 每个节点都不一样。
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
10 ) Presto 是由一个 coordinator 节点和多个 worker 节点组成。在 hadoop102 上配置成
coordinator ,在 hadoop103 、 hadoop104 上配置为 worker 。
( 1 ) hadoop102 上配置 coordinator 节点
[atguigu@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 节点
[atguigu@hadoop103 etc]$ vim config.properties
添加内容如下
coordinator=false
http-server.http.port=8881
query.max-memory=50GB
discovery.uri=http://hadoop102:8881
[atguigu@hadoop104 etc]$ vim config.properties
添加内容如下
coordinator=false
http-server.http.port=8881
query.max-memory=50GB
discovery.uri=http://hadoop102:8881
11 )在 hadoop102 的 /opt/module/hive 目录下,启动 Hive Metastore ,用 atguigu 角色
[atguigu@hadoop102 hive]$
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
13 )日志查看路径 /opt/module/presto/data/var/log
这篇关于(43)即席查询(Presto)的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!