Presto命令行Client安装
1)下载Presto的客户端
https://repo1.maven.org/maven2/com/facebook/presto/presto-cli/0.196/presto-cli-0.196-executable.jar
2)将presto-cli-0.196-executable.jar上传到hadoop101的/opt/module/presto文件夹下
3)修改文件名称
mv presto-cli-0.196-executable.jar prestocli
4)增加执行权限
chmod +x prestocli
5)启动prestocli
./prestocli --server hadoop101:8881 --catalog hive --schema default
6)Presto命令行操作
Presto的命令行操作,相当于Hive命令行操作。每个表必须要加上schema。
例如:
select * from schema.table limit 100
Presto可视化Client安装
1)将yanagishima-18.0.zip上传到hadoop101的/opt/module目录
2)解压缩yanagishima到module
unzip yanagishima-18.0.zip -d /opt/module/
cd yanagishima-18.0
3)进入到/opt/module/yanagishima-18.0/conf文件夹,编写yanagishima.properties配置
vim yanagishima.properties
添加如下内容
jetty.port=7080
presto.datasources=caron-presto
presto.coordinator.server.caron-presto=http://hadoop101:8881
catalog.caron-presto=hive
schema.caron-presto=default
sql.query.engines=presto
4)在/opt/module/yanagishima-18.0路径下启动yanagishima
nohup bin/yanagishima-start.sh >y.log 2>&1 &
5)启动web页面
http://hadoop101:7080
看到界面,进行查询了。
6)查看表结构
这里有个Tree View,可以查看所有表的结构,包括Schema、表、字段等。
比如执行select * from hive.dw_weather.tmp_news_click limit 10,这个句子里Hive这个词可以删掉,是上面配置的Catalog
每个表后面都有个复制键,点一下会复制完整的表名,然后再上面框里面输入sql语句,ctrl+enter键执行显示结果