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

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章