Presto 文档和笔记
1. Presto
Presto 官网
Presto 文档
2. 配置
3.1 node 配置
cat etc/node.properties
# Generated by Apache Ambari. Fri Feb 10 14:52:10 2023node.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 2023coordinator=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 2023coordinator=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 2023connector.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。