1、环境介绍
操作系统:centos 7.9
jdk版本:8u291
zeppelin版本:0.9.0
zeppelin下载地址:
http://zeppelin.apache.org/download.html
2、关闭防火墙和selinux
3、配置主机名,并配置hosts解析
4、配置JDK
https://blog.csdn.net/zyj81092211/article/details/118055068
5、上传软件包,解压并重命名/usr/local/zeppelin
6、设置zeppelin环境变量
vi /etc/profile
添加如下:
# zeppelin environment
export ZEPPELIN_HOME=/usr/local/zeppelin
export PATH=$ZEPPELIN_HOME/bin:$PATH
重新加载环境变量
source /etc/profile
7、更改配置文件,可以远程访问
cp /usr/local/zeppelin/conf/zeppelin-site.xml.template /usr/local/zeppelin/conf/zeppelin-site.xml
编辑zeppelin-site.xml,更改zeppelin.server.addr地址为0.0.0.0
8、启动zeppelin
zeppelin-daemon.sh start
9、访问zeppelin
浏览器输入zeppelin.wtown.com:8080
10、配置phoenix解释器
参考,完成hbase和phoenix相关准备
hbase HA 集群搭建
https://blog.csdn.net/zyj81092211/article/details/118632640
Hbase 集成 phoenix
https://blog.csdn.net/zyj81092211/article/details/118695495
使用Squirrel连接Phoenix
https://blog.csdn.net/zyj81092211/article/details/118876717
phoenix解释器官方案例:
https://zeppelin.apache.org/docs/0.9.0/interpreter/jdbc.html#apache-phoenix
(1)开始创建解释器:
(2)点击create创建
(3)输入名称和组
(4)填写参数:
default.url:jdbc:phoenix:zk01.wtown.com,zk02.wtown.com,zk02.wtown.com:/hbase1
default.driver:org.apache.phoenix.jdbc.PhoenixDriver
(5)依赖查询和填写
查询地址:
https://mvnrepository.com/artifact/org.apache.phoenix/phoenix-core
这里用到的phoenix版本是5.1.2
依赖值设置为:
org.apache.phoenix:phoenix-core:5.1.2
(6)点击save完成创建并查看
(7)创建notebook
这里就是刚才创建的notebook
11、测试
使用SQuirreL SQL Client创建测试数据
创建表:
CREATE TABLE IF NOT EXISTS STUDENT (
id VARCHAR NOT NULL PRIMARY KEY,
name VARCHAR,
age BIGINT,
gender VARCHAR ,
clazz VARCHAR
);
插入数据:
upsert into STUDENT values('10001','阿大',24,'男','理科三班');
upsert into STUDENT values('10002','阿二',24,'男','理科三班');
upsert into STUDENT values('10003','阿三',24,'女','理科一班');
upsert into STUDENT values('10004','阿四',24,'女','理科一班');
upsert into STUDENT values('10005','阿五',24,'男','理科二班');
upsert into STUDENT values('10006','阿六',24,'男','理科二班');
upsert into STUDENT values('10007','阿七',28,'男','理科二班');
upsert into STUDENT values('10008','阿八',28,'男','理科二班');
upsert into STUDENT values('10009','阿九',30,'男','理科一班');
upsert into STUDENT values('10010','阿十',30,'女','理科一班');
打开notebook bbase1
做一次班级人数统计
select count(1),clazz from STUDENT group by clazz
生成外链,可以迁入到程序中