presto实时查询引擎搭建

本文档介绍了如何搭建Presto实时查询引擎,包括下载0.85版本的Presto,配置config.properties、hive.properties文件,创建catalog目录,设置从节点配置,并在各台机器上分发及启动。同时,提供了使用presto-cli进行命令行访问的方法和相关参考资料链接。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

1、下载presto https://repo1.maven.org/maven2/com/facebook/presto/presto-server/

注意从0.86版本后只支持java 8,这里使用0.85版本+java 7,不然会出现

java.lang.UnsupportedClassVersionError: com/facebook/presto/server/PrestoServer : Unsupported major.minor version 52.0


2、解压tar包,进入conf目录,开始配置

config.properties

coordinator=true
node-scheduler.include-coordinator=false
http-server.http.port=10080
task.max-memory=5GB
discovery-server.enabled=true
discovery.uri=http://ip:10080

jvm.config

-server
-Xmx16G
-XX:+UseConcMarkSweepGC
-XX:+ExplicitGCInvokesConcurrent
-XX:+CMSClassUnloadingEnabled
-XX:+AggressiveOpts
-XX:+HeapDumpOnOutOfMemoryError
-XX:OnOutOfMemoryError=kill -9 %p
-XX:ReservedCodeCacheSize=150M

log.properties

com.facebook.presto=INFO

node.properties

node.environment=production
node.id=hostname-presto
node.data-dir=/var/presto/data

注意每台机器的node.properties里的node.id应该是唯一值,可用实际主机名替换hostname

复制core-site.xml、hdfs-site.xml到conf目录

3、在conf目录建立catalog目录

进入catalog目录,开始配置

hive.properties

connector.name=hive-cdh5
hive.metastore.uri=thrift://ip:9083
hive.config.resources=/usr/local/presto-server-0.85/etc/core-site.xml,/usr/local/presto-server-0.85/etc/hdfs-site.xml

jmx.properties

connector.name=jmx

4、以上为presto主结点配置,从结点修改

config.properties

coordinator=false
http-server.http.port=10080
task.max-memory=5GB
discovery-server.enabled=true
discovery.uri=http://ip:10080

以及注意node.properties里的node.id保持唯一

5、最后各台机器分发

启动关闭

/bin/launcher start

./bin/launcher stop

6、下载https://repo1.maven.org/maven2/com/facebook/presto/presto-cli/0.85/presto-cli-0.85-executable.jar
放入bin目录,重命名presto-cli,添加可执行权限,即可./presto-cli命令行进入

也可设置/etc/profile

export PRESTO_HOME=/usr/local/presto-server-0.85
alias presto='$PRESTO_HOME/bin/presto-cli --server ip:10080 --catalog hive --schema default'

命令行输入presto即可进入

参考

https://prestodb.io/
http://prestodb-china.com/ 
http://www.tuicool.com/articles/vU7rYzR

评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值