presto集群搭建(便于快速查询hive、kudu)

1.服务器及环境准备

服务器三台
192.168.0.1 uat03
192.168.0.2 uat04
192.168.0.3 uat05
自行安装好cdh,集成hdfs、spark、hive、kudu

2.下载

官网https://prestodb.io/download.html
下载最新的jar包 : presto-server-0.237.1.tar.gz 、 presto-cli-0.237.1-executable.jar
博主这里安装的是0.237.1版本的,官网已更新至0.238版本
在这里插入图片描述

3.安装

在服务器uat05上操作
a.解压presto-server-0.237.1.tar.gz 到目录/data
tar -zxvf presto-server-0.237.1.tar.gz -C /data

b.将presto-cli-0.237-executable.jar放到/data/presto-server-0.237.1/bin下,并赋予执行权
mv presto-cli-0.237-executable.jar /data/presto-server-0.237.1/bin
chmod 755 presto-cli-0.237.1-executable.jar

c.配置
在/data/presto-server-0.237.1/新建目录etc,并创建以下配置文件,内容如下
cd /data/presto-server-0.237.1
mkdir etc
cd etc

先创建几个文件夹、文件,后续会用到

mkdir -p /data/log/presto/
cd /data/log/presto/
touch server.log
touch launcher.log
mkdir -p /data/presto-server-0.237.1/data
mkdir -p /data/presto-server-0.237.1/etc/catalog

vim config.properties
注:discovery.uri该参数配置的是浏览器界面参数调优地址

# Conrdinator & Wroker
coordinator=true
node-scheduler.include-coordinator=true
http-server.http.port=8080
query.max-memory=32GB
query.max-memory-per-node=16GB
query.max-total-memory-per-node=16GB
discovery-server.enabled=true
discovery.uri=http://uat05:8080

exchange.http-client.connect-timeout=1m
exchange.http-client.idle-timeout=1m
exchange.http-client.max-connections=1000
exchange.http-client.max-connections-per-server=1000
scheduler.http-client.max-connections=1000
scheduler.http-client.max-connections-per-server=1000
scheduler.http-client.connect-timeout=1m
scheduler.http-client.idle-timeout=1m
query.client.timeout=5m
query.min-expire-age=30m
presto.version=0.237-master
## You may also wish to set the following properties:
# Specifies the port for the JMX RMI registry. JMX clients should connect to this port.
#jmx.rmiregistry.port:
# Specifies the port for the JMX RMI server. Presto exports many metrics that are useful for monitoring via JMX.
#jmx.rmiserver.port:

distributed-index-joins-enabled=true
exchange.client-threads=8
optimizer.optimize-hash-generation=true
query.hash-partition-count=2

vim jvm.config

#
# WARNING
# ^^^^^^^
# This configuration file is for development only and should NOT be used be
# used in production. For example configuration, see the Presto documentation.
#
-server
-Xmx48G
-XX:+UseG1GC
-XX:+ExplicitGCInvokesConcurrent
-XX:+AggressiveOpts
-XX:+HeapDumpOnOutOfMemoryError
-XX:OnOutOfMemoryError=kill -9 %p
-XX:InitiatingHeapOccupancyPercent=75
-XX:MaxGCPauseMillis=600
-XX:G1HeapRegionSize=32M
-XX:+UseGCOverheadLimit
-XX:+ExitOnOutOfMemoryError

vim log.properties

com.facebook.presto=INFO
com.sun.jersey.guice.spi.container.GuiceComponentProviderFactory=WARN
com.ning.http.client=WARN
com.facebook.presto.server.PluginManager=DEBUG

vim node.properties
注:uat03、uat04两台机器node.id参数要修改,不能相同,其他配置保持一致

node.environment=produce
node.id=db519624-18e8-4ee5-af30-a6545d10fcdq
node.data-dir=/data/presto-server-0.237.1/data
catalog.config-dir=/data/presto-server-0.237.1/etc/catalog
plugin.dir=/data/presto-server-0.237.1/plugin
node.server-log-file=/data/log/presto/server.log
node.launcher-log-file=/data/log/presto/launcher.log

在这里插入图片描述
进入catalog,配置相关文件
cd /data/presto-server-0.237.1/etc/catalog
vim hive.properties

connector.name=hive-hadoop2
# Hive Metastore 服务器端口
hive.metastore.uri=thrift://uat01:9083
hive.config.resources=/etc/hadoop/conf/core-site.xml,/etc/hadoop/conf/hdfs-site.xml,/etc/hadoop/conf/mapred-site.xml
# 是否允许在Presto中删除Hive中的表
hive.allow-drop-table=true
# 是否允许在Presto中重命名Hive中的表
hive.allow-rename-table=true

vim jmx.properties

connector.name=jmx

vim kudu.properties
注:uat01:7051为kudu主节点

connector.name=kudu

## List of Kudu master addresses, at least one is needed (comma separated)
## Supported formats: example.com, example.com:7051, 192.0.2.1, 192.0.2.1:7051,
##                    [2001:db8::1], [2001:db8::1]:7051, 2001:db8::1
kudu.client.master-addresses=uat01:7051

## Kudu does not support schemas, but the connector can emulate them optionally.
## By default, this feature is disabled, and all tables belong to the default schema.
## For more details see connector documentation.
#kudu.schema-emulation.enabled=false

## Prefix to use for schema emulation (only relevant if `kudu.schema-emulation.enabled=true`)
## The standard prefix is `presto::`. Empty prefix is also supported.
## For more details see connector documentation.
#kudu.schema-emulation.prefix=

#######################
### Advanced Kudu Java client configuration
#######################

## Default timeout used for administrative operations (e.g. createTable, deleteTable, etc.)
kudu.client.default-admin-operation-timeout = 30s

## Default timeout used for user operations
kudu.client.default-operation-timeout = 30s

## Default timeout to use when waiting on data from a socket
kudu.client.default-socket-read-timeout = 15s

## Disable Kudu client's collection of statistics.
#kudu.client.disable-statistics = false

d.分发到uat03、uat04服务器,注意修改node.properties配置文件中的node.id参数值
提前在uat03、uat04创建好目录
mkdir -p /data/presto-server-0.237.1
scp -r /data/presto-server-0.237.1/* root@uat03:/data/presto-server-0.237.1
scp -r /data/presto-server-0.237.1/* root@uat04:/data/presto-server-0.237.1

4.启动

bin/launcher start 后台运行
bin/launcher run 前台运行
建议使用后台启动,可关闭窗口

使用命令行进入查询界面
访问hive
bin/presto-cli-0.237.1-executable.jar --server uat05:8080 --catalog hive --schema default
访问kudu
bin/presto-cli-0.237.1-executable.jar --server uat05:8080 --catalog kudu --schema default

浏览器界面
http://uat05:8080
可通过界面各参数自行设置配置文件的各参数值
在这里插入图片描述

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值