presto web查询工具

一、Yanagishima工具包:

网上有很多,我这里用的是yanagishima-18.0.zip

也可以在官网下载源码编译,不过最新版本需要jdk11,现在企业中普遍使用jdk8,所以选了一个较低的版本

https://github.com/yanagishima/yanagishima

二、使用很简单,但是也遇到的一些坑,主要还是配置问题,由于我司的HTTP端口是通过代理映射出来,导致踩了一个大坑,另外配置的注释也要认真看看,不然容易配置错误。

# yanagishima web port
jetty.port=7080
# 30 minutes. If presto query exceeds this time, yanagishima cancel the query.
presto.query.max-run-time-seconds=1800
# 1GB. If presto query result file size exceeds this value, yanagishima cancel the query.
presto.max-result-file-byte-size=1073741824
# you can specify freely. But you need to specify same name to presto.coordinator.server.[...] and presto.redirect.server.[...] and .[...] and schema.[...]

# 这里presto.datasources参数随便填,但是presto.coordinator.server.[...] 和 catalog.[...] 和 schema.[...] 要和presto.datasources参数保持一致,如presto.coordinator.server.emr-presto ,如果写成presto.coordinator.server.presto就会出问题
presto.datasources=emr-presto
auth.your-presto=false
# presto coordinator url

# 这里配置服务器的IP,
presto.coordinator.server.emr-presto=http://ip:9090
# almost same as presto coordinator url. If you use reverse proxy, specify it

# 这里配置代理的路径,不能配置成IP+端口,不然你会报错的
presto.redirect.server.emr-presto=https://presto-pre.ops.cn
# presto catalog name
catalog.emr-presto=hive
# presto schema name
schema.emr-presto=default
# if query result exceeds this limit, to show rest of result is skipped
select.limit=500
# http header name for audit log
audit.http.header.name=some.auth.header
use.audit.http.header.name=false
# limit to convert from tsv to values query
to.values.query.limit=500
# authorization feature
check.datasource=false
hive.jdbc.url.emr-hive=jdbc:hive2://localhost:10000/default;auth=noSasl
hive.jdbc.user.emr-hive=hive
hive.jdbc.password.emr-hive=hive
hive.query.max-run-time-seconds=3600
hive.query.max-run-time-seconds.emr-hive=3600
resource.manager.url.emr-hive=https://yarn-pre.ops.cn
sql.query.engines=presto,hive
hive.datasources=emr-hive
hive.disallowed.keywords.emr-hive=insert,drop
# 1GB. If hive query result file size exceeds this value, yanagishima cancel the query.
hive.max-result-file-byte-size=1073741824
hive.setup.query.path.emr-hive=/usr/local/yanagishima/conf/hive_setup_query_emr-hive
cors.enabled=false

 

启动命令: nohup bin/yanagishima-start.sh >y.log 2>&1 &

关闭命令:bin/yanagishima-shutdown.sh 

 

yanagishima查询语法有点特别,我现在利用presto查询kafka的topic数据,数据库前缀要带kafka,不然不成功,而且不能用;号

SELECT * FROM kafka.default."dwd_trd_order_ni" LIMIT 100

 

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值