Zeppelin In Action

About Zeppelin

基于Web的笔记本,可通过SQL,Scala等实现数据驱动的交互式数据分析和协作文档。

Web-based notebook that enables data-driven, interactive data analytics and collaborative documents with SQL, Scala and more.

Architecture: 图片@apache zeppelin

Install and config

1
2
3
4
5
6
环境:
Centos 7.5
JDK1.8
zeppelin-0.9.0
网络:局域网使用

install 过程:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
wget https://mirrors.bfsu.edu.cn/apache/zeppelin/zeppelin-0.9.0/zeppelin-0.9.0-bin-all.tgz 
# https://mirrors.tuna.tsinghua.edu.cn/apache/zeppelin/zeppelin-0.9.0/zeppelin-0.9.0-bin-all.tgz

tar zxvf zeppelin-0.9.0-bin-all.tgz

#软链
ln -s zeppelin-0.9.0-bin-all zeppeline

#
cd zeppline

# 修改配置
cat<< EOF> conf/zeppelin-site.xml
<property>
<name>zeppelin.server.addr</name>
<value>0.0.0.0</value>
<description>Server binding address</description>
</property>

<property>
<name>zeppelin.server.port</name>
<value>8089</value>
<description>Server port.</description>
</property>
EOF


# start zeppline
./bin/zeppelin-daemon.sh start


配置一个interpreter

备注:建议增加一个内网的maven 私服 repostory 地址,便于jar依赖下载

interperter增加 interpreter

1
2
3
4
5
6
7
8
default.url:   jdbc:mysql://172.17.8.85:3306/
default.user root
default.password ***
default.driver com.mysql.jdbc.Driver


Dependencies:
mysql:mysql-connector-java:5.1.49

  • interpreter 命令
1
2
3
4
5
6
7
8
9
10
11
#nstall all community managed interpreters
./bin/install-interpreter.sh --all


# You can get full list of community managed interpreters by running
./bin/install-interpreter.sh --list

# add 第三方 interpreter
#rd party interpreters
#http://zeppelin.apache.org/docs/0.9.0/usage/interpreter/installation.html#3rd-party-interpreters

zeppline 进行数据可视化分析

1
2
3
%mysql 
select tab2.user_name,count(*) as auth_obj_num from tb_dp_hero_auth_info as tab1 left join tb_dp_hero_user_info tab2 on tab1.user_id = tab2.id group by tab1.user_id ;

分析用户的授权对象个数:

参考文章

zeppelin interpreter zeppelin architecture