presto环境部署

 一、环境准备

presto环境节点规划:

10.21.58.94(coordinator服务)

10.21.58.95(worker服务)

10.21.58.96(worker服务)

 

presto下载并解压:

部署的presto版本为0.223.1,下载路径为 /opt/bigdata/app/

下载地址:https://repo1.maven.org/maven2/com/facebook/presto/presto-server/0.223.1/presto-server-0.223.1.jar

二、部署流程

2.1 配置presto

在presto解压路径下新建 etc/ 目录,配置如下文件:

  • config.properties:配置presto服务,配置成cooridinator服务还是worker服务。
  • node.properties:配置指定节点的环境属性。
  • jvm.properties:配置java虚拟机环境相关参数。
  • catalog属性:配置数据连接源。
  • log.properties:配置log相关属性。

2.2 coordinator服务配置

config.properties配置

# cat config.properties 
coordinator=true
node-scheduler.include-coordinator=false
http-server.http.port=8088
query.max-memory=100GB
query.max-memory-per-node=10GB
query.max-total-memory-per-node=20GB
discovery-server.enabled=true
discovery.uri=http://10.21.58.94:8088

参数含义:

  • coordinator=true:是否启用coordinator服务
  • node-scheduler.include-coordinator=false:在coordinator服务节点是否启用worker服务,true表示coordinator服务和worker服务混部
  • http-server.http.port=8088:http服务的端口
  • query.max-memory=100GB:整个presto集群查询的最大数据量
  • query.max-memory-per-node=10GB:单个woker节点单个task查询的数据量
  • query.max-total-memory-per-node=20GB:单个worker节点查询的最大数据量
  • discovery-server.enabled=true:是否开启discover服务,用于其它worker访问
  • discovery.uri:discovery服务的web uri地址

node.properties配置

# cat node.properties 
node.environment=production
node.id=10-21-58-94
node.data-dir=/data/presto/

参数含义:

  • node.environment=production:worker节点的环境类型(coordinator服务所在节点没有启用worker服务,所以这个配置文件作用不大)
  • node.id=10-21-58-94:worker节点的id
  • node.data-dir=/data/presto/:worker节点服务的日志目录

jvm.config配置

# cat jvm.config 
-server
-Xmx64G
-XX:+UseG1GC
-XX:G1HeapRegionSize=32M
-XX:+UseGCOverheadLimit
-XX:+ExplicitGCInvokesConcurrent
-XX:+HeapDumpOnOutOfMemoryError
-XX:+ExitOnOutOfMemoryError

log.properties配置

# cat log.properties 
com.facebook.presto=DEBUG

2.3 worker服务配置

# cat config.properties 
coordinator=false
http-server.http.port=8088
query.max-memory=100GB
query.max-memory-per-node=10GB
query.max-total-memory-per-node=20GB
discovery.uri=http://10.21.58.94:8088

# cat node.properties 
node.environment=production
node.id=10-21-58-95
node.data-dir=/data/presto/

# cat jvm.config 
-server
-Xmx64G
-XX:+UseG1GC
-XX:G1HeapRegionSize=32M
-XX:+UseGCOverheadLimit
-XX:+ExplicitGCInvokesConcurrent
-XX:+HeapDumpOnOutOfMemoryError
-XX:+ExitOnOutOfMemoryError

# cat catalog/hive.properties 
connector.name=hive-hadoop2
hive.metastore.uri=thrift://10.21.58.94:9083
hive.config.resources=/opt/bigdata/app/presto/etc/hadoop-conf/core-site.xml,/opt/bigdata/app/presto/etc/hadoop-conf/hdfs-site.xml
hive.security=read-only
hive.hdfs.authentication.type=NONE
hive.hdfs.impersonation.enabled=true

# cat log.properties 
com.facebook.presto=DEBUG

2.4 catalog连接器配置

环境连接的是hive数据源,配置方式见2.2小节和2.3小节的 catalog/hive.properties 配置。

2.5 验证

打开web ui地址 10.21.58.94:8088,出现如下页面则说明配置成功。

 三、命令行访问

下载presto客户端执行jar包 https://repo1.maven.org/maven2/com/facebook/presto/presto-cli/0.223.1/presto-cli-0.223.1-executable.jar

 重命名jar包名为 presto,并添加可执行属性 chmod +x presto,通过如下方式访问:

/opt/bigdata/presto-cli/presto --server 10.21.58.94:8088 --catalog hive --schema default --user 11085245 --debug

 

【参考链接】

[1] https://prestodb.io/docs/current/installation/deployment.html.

posted @ 2020-01-14 23:15  笨小康u  阅读(863)  评论(0编辑  收藏  举报