zepplin实战
一句话介绍Zeppelin
以笔记(Note)的形式展示的数据可视化工具。
一.下载安装启动
http://zeppelin.apache.org/download.html
wgethttp://mirrors.tuna.tsinghua.edu.cn/apache/zeppelin/zeppelin-0.7.3/zeppelin-0.7.3-bin-all.tgz
tar-zvxfzeppelin-0.7.3-bin-all.tgz-C/opt
bin/zeppelin-daemon.shstart
二.配置Interpreters
连接hive
default.driverorg.apache.hive.jdbc.HiveDriver
default.urljdbc:hive2://172.18.203.131:10000/default
default.userroot(注意,这个配置会导致没有权限,连接失败)
具体可以参考hive的日志,http://master1:10002/logs/
上传hive相关包,注意版本驱动版本和装的hive版本一致,到/opt/zeppelin-0.7.3-bin-all/lib
hive-common-1.1.0.jar
hive-jdbc-1.1.0.jar
hive-metastore-1.1.0.jar
hive-serde-1.1.0.jar
hive-service-1.1.0.jar
连接kylin
kylin.api.userADMIN
kylin.api.passwordKYLIN
kylin.api.urlhttp://master1:7070/kylin/api/query
kylin.query.projectHiveProject
三.创建note
%jdbc
selectfact.time_key,sum(fact.quantity_ordered),sum(fact.order_dollars),sum(fact.cost_dollars)fromfact_orderasfact
wherefact.time_key>="2016-05-01"andfact.time_key<="2016-05-15"
groupbyfact.time_keyorderbyfact.time_key;
%kylin
selectfact.time_key,sum(fact.quantity_ordered),sum(fact.order_dollars),sum(fact.cost_dollars)fromfact_orderasfact
wherefact.time_keybetween'2016-05-01'and'2016-05-15'
groupbyfact.time_keyorderbyfact.time_key