大家好,我是怀瑾握瑜,一只大数据萌新,家有两只吞金兽,嘉与嘉,上能 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 中,解压缩
# 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
coordinator=true #是coordinator节点
node-scheduler.include-coordinator=true #是coordinator节点,同时是woker节点
http-server.http.port=9002 # HTTP端口
query.max-memory=6GB
query.max-memory-per-node=2GB
query.max-total-memory-per-node=4GB
discovery-server.enabled=true #Presto使用Discovery服务查找群集中的所有节点
discovery.uri=http://cdh1:9002 #http地址
http-server.http.port: Specifies the port for the HTTP server. Presto uses HTTP for all communication, internal and external.
discovery.uri: The URI to the Discovery server.
Because we have enabled the embedded version of Discovery in the Presto coordinator,
this should be the URI of the Presto coordinator.
Replace example.net:8080 to match the host and port of the Presto coordinator.
This URI must not end in a slash.
复制代码
——————————————woker 节点配置-----------------------------------------------------------------
修改 config.properties
coordinator=false #是coordinator节点
node-scheduler.include-coordinator=false #是woker节点
http-server.http.port=9002 # HTTP端口
query.max-memory=6GB
query.max-memory-per-node=2GB
query.max-total-memory-per-node=4GB
#discovery-server.enabled=true #注释掉
discovery.uri=http://cdh1:9002 #coordinator节点地址
复制代码
4.1.2 catalog/hive.properties 修改 hive 的连接
connector.name=hive-hadoop2 #写死格式
hive.metastore.uri=thrift://cdh1:9083 #hive.metastore.uri与端口
hive.config.resources=/etc/hadoop/conf/core-site.xml,/etc/hadoop/conf/hdfs-site.xml #core-site.xml与hdfs-site.xml 位置
在hive的catalog配置文件中,加入如下配置 hive.parquet.fail-on-corrupted-statistics=false
复制代码
4.1.3 node.properties 配置
node.environment=dev #集群名称 (统一值)
node.id=presto-node2 #本节点名称(唯一值)
node.data-dir=/data1/presto/data #自定义数据路径
复制代码
4.1.4 catalog/kudu.properties
cat kudu.properties
connector.name=kudu
kudu.client.master-addresses=192.168.135.42:7051,192.168.135.43:7051,192.168.135.44:7051
复制代码
5. 启动 Presto
相应的权限如果没有,进行赋值
查看页面
http://172.29.30.63:9001/ui/
6. yanagishima 安装
拷贝 yanagishima-20.0.zip 到/app 中,解压缩
修改/conf/yanagishima.properties,针对连接进行修改
启动
7.环境特殊处理
hive 3.1.0 版本,需要修改配置
hive.metastore.client.capability.check = false
hive.strict.managed.tables=false
hive.create.as.insert.only=false
metastore.create.as.acid=false
复制代码
访问外部表需要修改权限
结束语
如果您喜欢我的文章,可以[关注⭐]+[点赞👍]+[评论📃],您的三连是我前进的动力,期待与您共同成长~
可关注企鹅号【怀瑾握瑜的嘉与嘉】,获取资源下载方式
评论