大家好,我是怀瑾握瑜,一只大数据萌新,家有两只吞金兽,嘉与嘉,上能code下能teach的全能奶爸 如果您喜欢我的文章,可以[关注⭐]+[点赞👍]+[评论📃],您的三连是我前进的动力,期待与您共同成长~


1. Presto官网教程

https://prestodb.io/docs/current/installation.html

2. 下载地址

下载安装包:https://prestodb.io/download.html
或使用压缩好的zip包presto-server-0.256.zip

3. 上传升级包

上传到/app中,解压缩

  1. # tar -xvf presto-server-0.256.zip

4. 配置Presto

在安装目录下创建一个etc目录。在etc目录下配置以下信息:

节点属性(Node Properties):每个节点的环境配置信息
JVM配置(JVM Config):JVM的命令行选项
注意:hive3.1,因为权限问题,在该配置中需要增加hadoop用户
-DHADOOP_USER_NAME=hdfs
配置属性(Config Properties):PrestoServer的配置信息
日志级别(Log Properties):日志级别配置信息
Catalog属性(Catalog Properties):连接器配置信息(数据源)

work节点使用config.properties.work配置文件
node.properties,work节点需要更改id
Catalog中连接属性需要根据环境进行配置

4.1. 本次部署presto部署5个点,分别传到5台机器上

4.1.2 修改配置

——————————————coordinator节点配置————————————————————————————————-
修改config.properties

  1. coordinator=true #是coordinator节点
  2. node-scheduler.include-coordinator=true #是coordinator节点,同时是woker节点
  3. http-server.http.port=9002 # HTTP端口
  4. query.max-memory=6GB
  5. query.max-memory-per-node=2GB
  6. query.max-total-memory-per-node=4GB
  7. discovery-server.enabled=true #Presto使用Discovery服务查找群集中的所有节点
  8. discovery.uri=http://cdh1:9002 #http地址
  9. http-server.http.port: Specifies the port for the HTTP server. Presto uses HTTP for all communication, internal and external.
  10. discovery.uri: The URI to the Discovery server.
  11. Because we have enabled the embedded version of Discovery in the Presto coordinator,
  12. this should be the URI of the Presto coordinator.
  13. Replace example.net:8080 to match the host and port of the Presto coordinator.
  14. This URI must not end in a slash.

——————————————woker节点配置————————————————————————————————-
修改config.properties

  1. coordinator=false #是coordinator节点
  2. node-scheduler.include-coordinator=false #是woker节点
  3. http-server.http.port=9002 # HTTP端口
  4. query.max-memory=6GB
  5. query.max-memory-per-node=2GB
  6. query.max-total-memory-per-node=4GB
  7. #discovery-server.enabled=true #注释掉
  8. discovery.uri=http://cdh1:9002 #coordinator节点地址

4.1.2 catalog/hive.properties 修改hive 的连接

  1. connector.name=hive-hadoop2 #写死格式
  2. hive.metastore.uri=thrift://cdh1:9083 #hive.metastore.uri与端口
  3. hive.config.resources=/etc/hadoop/conf/core-site.xml,/etc/hadoop/conf/hdfs-site.xml #core-site.xml与hdfs-site.xml 位置
  4. hivecatalog配置文件中,加入如下配置 hive.parquet.fail-on-corrupted-statistics=false

4.1.3 node.properties 配置

  1. node.environment=dev #集群名称 (统一值)
  2. node.id=presto-node2 #本节点名称(唯一值)
  3. node.data-dir=/data1/presto/data #自定义数据路径

4.1.4 catalog/kudu.properties

  1. cat kudu.properties
  2. connector.name=kudu
  3. kudu.client.master-addresses=192.168.135.42:7051,192.168.135.43:7051,192.168.135.44:7051

5. 启动Presto

相应的权限如果没有,进行赋值

  1. # bin/launcher start

查看页面
http://172.29.30.63:9001/ui/

6. yanagishima安装

拷贝yanagishima-20.0.zip到/app中,解压缩
修改/conf/yanagishima.properties,针对连接进行修改
启动

  1. # ./start.sh

7.环境特殊处理

hive 3.1.0版本,需要修改配置

  1. hive.metastore.client.capability.check = false
  2. hive.strict.managed.tables=false
  3. hive.create.as.insert.only=false
  4. metastore.create.as.acid=false

访问外部表需要修改权限


结束语

如果您喜欢我的文章,可以[关注⭐]+[点赞👍]+[评论📃],您的三连是我前进的动力,期待与您共同成长~ 可关注企鹅号【怀瑾握瑜的嘉与嘉】,获取资源下载方式