Presto 文档和笔记

1 篇文章 0 订阅
文章详细介绍了如何配置Presto以访问Hive数据,包括Presto的node.properties、jvm.config和config.properties等配置文件的设置,以及如何通过修改hive.properties来连接其他集群的HDFS。此外,还提到了通过调整/etc/hosts和重启Presto服务来实现跨集群访问。
摘要由CSDN通过智能技术生成

1. Presto

Presto 官网
Presto 文档

2. 配置

3.1 node 配置

cat etc/node.properties 
# Generated by Apache Ambari. Fri Feb 10 14:52:10 2023
    
node.data-dir=/mnt/bmr/presto/data
node.environment=production
node.id=bmr-master-4b7cbaa

3.2 jvm 配置

cat etc/jvm.config 
-server
-Xmx16G
-XX:+UseG1GC
-XX:G1HeapRegionSize=32M
-XX:+UseGCOverheadLimit
-XX:+ExplicitGCInvokesConcurrent
-XX:+HeapDumpOnOutOfMemoryError

3.3 config 配置

3.3.1 master 端配置
[root@bmr-master-4b7cbaa presto]# cat etc/config.properties 
# Generated by Apache Ambari. Fri Feb 10 14:52:10 2023
    
coordinator=true
discovery-server.enabled=true
discovery.uri=http://bmr-master-4b7cbaa:8089
http-server.http.port=8089
node-scheduler.include-coordinator=false
query.max-memory=50GB
query.max-memory-per-node=1GB
query.max-total-memory-per-node=2GB
3.3.2 worker 端配置
[root@bmr-core-16157a3-1 ~]# cat /opt/bmr/presto/etc/config.properties 
# Generated by Apache Ambari. Fri Feb 10 14:49:23 2023
    
coordinator=false
discovery.uri=http://bmr-master-4b7cbaa:8089
http-server.http.port=8089
node-scheduler.include-coordinator=false
query.max-memory=50GB
query.max-memory-per-node=1GB
query.max-total-memory-per-node=2GB

3.4 hive catalog 配置

[root@bmr-master-4b7cbaa presto]# cat etc/catalog/hive.properties 
# Generated by Apache Ambari. Fri Feb 10 14:52:10 2023
    
connector.name=hive-hadoop2
hive.config.resources=/etc/hadoop/conf/core-site.xml,/etc/hadoop/conf/hdfs-site.xml
hive.metastore.uri=thrift://bmr-master-4b7cbaa:9083
hive.non-managed-table-creates-enabled=true
hive.non-managed-table-writes-enabled=true

3 运行 Presto 命令

[root@bmr-master-4b7cbaa presto]# bin/presto-cli-0.219-executable.jar --server localhost:8089 --catalog hive --schema default
presto:default> show tables;
  Table   
----------
 filter   
 t1       
 v_filter 
(3 rows)

Query 20230214_005709_00002_6tcin, FINISHED, 4 nodes
Splits: 53 total, 53 done (100.00%)
0:00 [3 rows, 67B] [6 rows/s, 146B/s]

4. Presto 访问其他集群的方案

4.1 同步 /etc/hosts

把要访问集群的服务器配置放到 Presto 集群所有服务器的 /etc/hosts

4.2 修改 hive.properties

使用 ambari 把 Presto 的 hive.properties 的 hive.metastore.uri 参数的值为其他集群。

4.3 重启 Presto

使用 ambari 重启 Presto。可以访问其他集群的 HDFS 上的数据。但是不能访问 bos 的数据,因为 Presto 没有 bos 相关的 jar。

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值