Skip to content

Commit 2bdae11

Browse files
authored
Fix dependency bug and add documents (#2299)
* Fix dependency bug and add documents
1 parent b75ceb0 commit 2bdae11

File tree

4 files changed

+394
-194
lines changed

4 files changed

+394
-194
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,184 @@
1+
<!--
2+
3+
Licensed to the Apache Software Foundation (ASF) under one
4+
or more contributor license agreements. See the NOTICE file
5+
distributed with this work for additional information
6+
regarding copyright ownership. The ASF licenses this file
7+
to you under the Apache License, Version 2.0 (the
8+
"License"); you may not use this file except in compliance
9+
with the License. You may obtain a copy of the License at
10+
11+
http://www.apache.org/licenses/LICENSE-2.0
12+
13+
Unless required by applicable law or agreed to in writing,
14+
software distributed under the License is distributed on an
15+
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16+
KIND, either express or implied. See the License for the
17+
specific language governing permissions and limitations
18+
under the License.
19+
20+
-->
21+
22+
# 1. Outline
23+
24+
- What's Zeppelin
25+
26+
- IoTDB Zeppelin-Interpreter
27+
- System Requirements
28+
- Build Interpreter
29+
- Install Interpreter
30+
- Running Zeppelin and IoTDB
31+
- Use Zeppelin-IoTDB
32+
- Configuration
33+
34+
35+
36+
# 2. What's Zeppelin
37+
38+
Zeppelin is a web-based notebook that enables interactive data analytics. You can connect to data sources and perform interactive operations with SQL, Scala, etc. The operations can be saved as documents, just like Jupyter. Zeppelin has already supported many data sources, including Spark, ElasticSearch, Cassandra, and InfluxDB. Now, we have enabled Zeppelin to operate IoTDB via SQL.
39+
40+
![iotdb-note-snapshot](https://user-images.githubusercontent.com/5548915/102752947-520a3e80-43a5-11eb-8fb1-8fac471c8c7e.png)
41+
42+
43+
44+
# 3. Zeppelin-IoTDB Interpreter
45+
46+
## System Requirements
47+
48+
| IoTDB Version | Java Version | Zeppelin Version |
49+
| :-----------: | :-----------: | :--------------: |
50+
| >=`0.12.0-SNAPSHOT` | >=`1.8.0_271` | `>=0.9.0` |
51+
52+
You can install IoTDB according to [IoTDB Quick Start](https://iotdb.apache.org/UserGuide/Master/Get%20Started/QuickStart.html). Suppose IoTDB is placed at `$IoTDB_HOME`.
53+
54+
You can download [Zeppelin](https://zeppelin.apache.org/download.html#) and unpack the binary package directly or [build Zeppelin from source](https://zeppelin.apache.org/docs/latest/setup/basics/how_to_build.html). Suppose Zeppelin is placed at `$Zeppelin_HOME`.
55+
56+
57+
58+
## 3.2 Build Interpreter
59+
60+
```
61+
cd $IoTDB_HOME
62+
mvn clean package -pl zeppelin-interpreter -am -DskipTests
63+
```
64+
65+
The interpreter will be in the folder:
66+
67+
```
68+
$IoTDB_HOME/zeppelin-interpreter/target/zeppelin-{version}-SNAPSHOT-jar-with-dependencies.jar
69+
```
70+
71+
72+
73+
## 3.3 Install Interpreter
74+
75+
Once you have built your interpreter, create a new folder under the Zeppelin interpreter directory and put the built interpreter into it.
76+
77+
```
78+
cd $IoTDB_HOME
79+
mkdir -p $Zeppelin_HOME/interpreter/iotdb
80+
cp $IoTDB_HOME/zeppelin-interpreter/target/zeppelin-{version}-SNAPSHOT-jar-with-dependencies.jar $Zeppelin_HOME/interpreter/iotdb
81+
```
82+
83+
84+
85+
## 3.4 Running Zeppelin and IoTDB
86+
87+
Go to `$Zeppelin_HOME` and start Zeppelin by running:
88+
89+
```
90+
./bin/zeppelin-daemon.sh start
91+
```
92+
93+
or in Windows:
94+
95+
```
96+
.\bin\zeppelin.cmd
97+
```
98+
99+
Go to `$IoTDB_HOME` and [start IoTDB server](https://github.com/apache/iotdb#start-iotdb):
100+
101+
```
102+
# Unix/OS X
103+
> nohup sbin/start-server.sh >/dev/null 2>&1 &
104+
or
105+
> nohup sbin/start-server.sh -c <conf_path> -rpc_port <rpc_port> >/dev/null 2>&1 &
106+
107+
# Windows
108+
> sbin\start-server.bat -c <conf_path> -rpc_port <rpc_port>
109+
```
110+
111+
112+
113+
# 4. Use Zeppelin-IoTDB
114+
115+
Wait for Zeppelin server to start, then visit http://127.0.0.1:8080/
116+
117+
In the interpreter page:
118+
119+
1. Click the `Create new node` button
120+
2. Set the note name
121+
3. Configure your interpreter
122+
123+
Now you are ready to use your interpreter.
124+
125+
![iotdb-create-note](https://user-images.githubusercontent.com/5548915/102752945-5171a800-43a5-11eb-8614-53b3276a3ce2.png)
126+
127+
We provide some simple SQL to show the use of Zeppelin-IoTDB interpreter:
128+
129+
```sql
130+
SET STORAGE GROUP TO root.ln.wf01.wt01;
131+
CREATE TIMESERIES root.ln.wf01.wt01.status WITH DATATYPE=BOOLEAN, ENCODING=PLAIN;
132+
CREATE TIMESERIES root.ln.wf01.wt01.temperature WITH DATATYPE=FLOAT, ENCODING=PLAIN;
133+
CREATE TIMESERIES root.ln.wf01.wt01.hardware WITH DATATYPE=INT32, ENCODING=PLAIN;
134+
135+
INSERT INTO root.ln.wf01.wt01 (timestamp, temperature, status, hardware)
136+
VALUES (1, 1.1, false, 11);
137+
138+
INSERT INTO root.ln.wf01.wt01 (timestamp, temperature, status, hardware)
139+
VALUES (2, 2.2, true, 22);
140+
141+
INSERT INTO root.ln.wf01.wt01 (timestamp, temperature, status, hardware)
142+
VALUES (3, 3.3, false, 33);
143+
144+
INSERT INTO root.ln.wf01.wt01 (timestamp, temperature, status, hardware)
145+
VALUES (4, 4.4, false, 44);
146+
147+
INSERT INTO root.ln.wf01.wt01 (timestamp, temperature, status, hardware)
148+
VALUES (5, 5.5, false, 55);
149+
150+
151+
SELECT *
152+
FROM root.ln.wf01.wt01
153+
WHERE time >= 1
154+
AND time <= 6;
155+
```
156+
157+
The screenshot is as follows:
158+
159+
![iotdb-note-snapshot2](https://user-images.githubusercontent.com/5548915/102752948-52a2d500-43a5-11eb-9156-0c55667eb4cd.png)
160+
161+
You can also design more fantasy documents referring to [[1]](https://zeppelin.apache.org/docs/0.9.0-SNAPSHOT/usage/display_system/basic.html) and others.
162+
163+
The above demo notebook can be found at `$IoTDB_HOME/zeppelin-interpreter/Zeppelin-IoTDB-Demo.zpln`.
164+
165+
166+
167+
# 5. Configuration
168+
169+
You can configure the connection parameters in http://127.0.0.1:8080/#/interpreter :
170+
171+
![iotdb-configuration](https://user-images.githubusercontent.com/5548915/102752940-50407b00-43a5-11eb-94fb-3e3be222183c.png)
172+
173+
The parameters you can configure are as follows:
174+
175+
| Property | Default | Description |
176+
| ---------------------------- | --------- | ------------------------------- |
177+
| iotdb.host | 127.0.0.1 | IoTDB server host to connect to |
178+
| iotdb.port | 6667 | IoTDB server port to connect to |
179+
| iotdb.username | root | Username for authentication |
180+
| iotdb.password | root | Password for authentication |
181+
| iotdb.fetchSize | 10000 | Query fetch size |
182+
| iotdb.zoneId | | Zone Id |
183+
| iotdb.enable.rpc.compression | FALSE | Whether enable rpc compression |
184+
| iotdb.time.display.type | default | The time format to display |
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,186 @@
1+
<!--
2+
3+
Licensed to the Apache Software Foundation (ASF) under one
4+
or more contributor license agreements. See the NOTICE file
5+
distributed with this work for additional information
6+
regarding copyright ownership. The ASF licenses this file
7+
to you under the Apache License, Version 2.0 (the
8+
"License"); you may not use this file except in compliance
9+
with the License. You may obtain a copy of the License at
10+
11+
http://www.apache.org/licenses/LICENSE-2.0
12+
13+
Unless required by applicable law or agreed to in writing,
14+
software distributed under the License is distributed on an
15+
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16+
KIND, either express or implied. See the License for the
17+
specific language governing permissions and limitations
18+
under the License.
19+
20+
-->
21+
22+
# 概要
23+
24+
* Zeppelin简介
25+
* IoTDB Zeppelin 解释器
26+
* 系统环境要求
27+
* 编译解释器
28+
* 安装解释器
29+
* 启动Zeppelin和IoTDB
30+
* 使用Zeppelin-IoTDB解释器
31+
* 解释器配置项
32+
33+
34+
35+
# 2. Zeppelin简介
36+
37+
Apache Zeppelin 是一个基于网页的交互式数据分析系统。用户可以通过Zeppelin连接数据源并使用SQL、Scala等进行交互式操作。操作可以保存为文档(类似于Jupyter)。Zeppelin支持多种数据源,包括Spark、ElasticSearch、Cassandra和InfluxDB等等。现在,IoTDB已经支持使用Zeppelin进行操作。样例如下:
38+
39+
![iotdb-note-snapshot](https://user-images.githubusercontent.com/5548915/102752947-520a3e80-43a5-11eb-8fb1-8fac471c8c7e.png)
40+
41+
42+
43+
# 3. Zeppelin-IoTDB解释器
44+
45+
## 系统环境需求
46+
47+
| IoTDB 版本 | Java 版本 | Zeppelin 版本 |
48+
| :--------: | :-----------: | :-----------: |
49+
| >=`0.12.0-SNAPSHOT` | >=`1.8.0_271` | `>=0.9.0` |
50+
51+
> 用户需要首先安装IoTDB:[IoTDB Quick Start](https://iotdb.apache.org/UserGuide/Master/Get%20Started/QuickStart.html). 假设 IoTDB 安装在 `$IoTDB_HOME`.
52+
>
53+
> 用户可以下载 [Zeppelin](https://zeppelin.apache.org/download.html#) 并解压二进制文件,或 [从源码构建Zeppelin](https://zeppelin.apache.org/docs/latest/setup/basics/how_to_build.html). 假设 Zeppelin 安装在 `$Zeppelin_HOME`.
54+
55+
56+
57+
## 3.2 编译解释器
58+
59+
运行如下命令编译IoTDB Zeppelin解释器。
60+
61+
```shell
62+
cd $IoTDB_HOME
63+
mvn clean package -pl zeppelin-interpreter -am -DskipTests
64+
```
65+
66+
编译后的解释器位于如下目录:
67+
68+
```shell
69+
$IoTDB_HOME/zeppelin-interpreter/target/zeppelin-{version}-SNAPSHOT-jar-with-dependencies.jar
70+
```
71+
72+
73+
74+
## 3.3 安装解释器
75+
76+
当你编译好了解释器,在Zeppelin的解释器目录下创建一个新的文件夹`iotdb`,并将IoTDB解释器放入其中。
77+
78+
```shell
79+
cd $IoTDB_HOME
80+
mkdir -p $Zeppelin_HOME/interpreter/iotdb
81+
cp $IoTDB_HOME/zeppelin-interpreter/target/zeppelin-{version}-SNAPSHOT-jar-with-dependencies.jar $Zeppelin_HOME/interpreter/iotdb
82+
```
83+
84+
85+
86+
## 3.4 启动 Zeppelin 和 IoTDB
87+
88+
进入 `$Zeppelin_HOME` 并运行Zeppelin:
89+
90+
```shell
91+
# Unix/OS X
92+
> ./bin/zeppelin-daemon.sh start
93+
94+
# Windows
95+
> .\bin\zeppelin.cmd
96+
```
97+
98+
99+
100+
进入 `$IoTDB_HOME` 并运行IoTDB:
101+
102+
```shell
103+
# Unix/OS X
104+
> nohup sbin/start-server.sh >/dev/null 2>&1 &
105+
or
106+
> nohup sbin/start-server.sh -c <conf_path> -rpc_port <rpc_port> >/dev/null 2>&1 &
107+
108+
# Windows
109+
> sbin\start-server.bat -c <conf_path> -rpc_port <rpc_port>
110+
```
111+
112+
113+
114+
# 4. 使用 Zeppelin-IoTDB解释器
115+
116+
当Zeppelin启动后,访问 [http://127.0.0.1:8080/](http://127.0.0.1:8080/)
117+
118+
通过如下步骤创建一个新的笔记本页面:
119+
120+
1. 点击 `Create new node` 按钮
121+
2. 设置笔记本名
122+
3. 选择解释器为iotdb
123+
124+
现在可以开始使用Zeppelin操作IoTDB了。
125+
126+
![iotdb-create-note](https://user-images.githubusercontent.com/5548915/102752945-5171a800-43a5-11eb-8614-53b3276a3ce2.png)
127+
128+
我们提供了一些简单的SQL来展示Zeppelin-IoTDB解释器的使用:
129+
130+
```sql
131+
SET STORAGE GROUP TO root.ln.wf01.wt01;
132+
CREATE TIMESERIES root.ln.wf01.wt01.status WITH DATATYPE=BOOLEAN, ENCODING=PLAIN;
133+
CREATE TIMESERIES root.ln.wf01.wt01.temperature WITH DATATYPE=FLOAT, ENCODING=PLAIN;
134+
CREATE TIMESERIES root.ln.wf01.wt01.hardware WITH DATATYPE=INT32, ENCODING=PLAIN;
135+
136+
INSERT INTO root.ln.wf01.wt01 (timestamp, temperature, status, hardware)
137+
VALUES (1, 1.1, false, 11);
138+
139+
INSERT INTO root.ln.wf01.wt01 (timestamp, temperature, status, hardware)
140+
VALUES (2, 2.2, true, 22);
141+
142+
INSERT INTO root.ln.wf01.wt01 (timestamp, temperature, status, hardware)
143+
VALUES (3, 3.3, false, 33);
144+
145+
INSERT INTO root.ln.wf01.wt01 (timestamp, temperature, status, hardware)
146+
VALUES (4, 4.4, false, 44);
147+
148+
INSERT INTO root.ln.wf01.wt01 (timestamp, temperature, status, hardware)
149+
VALUES (5, 5.5, false, 55);
150+
151+
152+
SELECT *
153+
FROM root.ln.wf01.wt01
154+
WHERE time >= 1
155+
AND time <= 6;
156+
```
157+
158+
样例如下:
159+
160+
![iotdb-note-snapshot2](https://user-images.githubusercontent.com/5548915/102752948-52a2d500-43a5-11eb-9156-0c55667eb4cd.png)
161+
162+
用户也可以参考 [[1]](https://zeppelin.apache.org/docs/0.9.0-SNAPSHOT/usage/display_system/basic.html) 编写更丰富多彩的文档。
163+
164+
以上样例放置于 `$IoTDB_HOME/zeppelin-interpreter/Zeppelin-IoTDB-Demo.zpln`
165+
166+
167+
168+
# 5. 解释器配置项
169+
170+
进入页面 [http://127.0.0.1:8080/#/interpreter](http://127.0.0.1:8080/#/interpreter) 并配置IoTDB的连接参数:
171+
172+
![iotdb-configuration](https://user-images.githubusercontent.com/5548915/102752940-50407b00-43a5-11eb-94fb-3e3be222183c.png)
173+
174+
可配置参数默认值和解释如下:
175+
176+
| 属性 | 默认值 | 描述 |
177+
| ---------------------------- | --------- | -------------------------------- |
178+
| iotdb.host | 127.0.0.1 | IoTDB 主机名 |
179+
| iotdb.port | 6667 | IoTDB 端口 |
180+
| iotdb.username | root | 用户名 |
181+
| iotdb.password | root | 密码 |
182+
| iotdb.fetchSize | 10000 | 查询结果分批次返回时,每一批数量 |
183+
| iotdb.zoneId | | 时区ID |
184+
| iotdb.enable.rpc.compression | FALSE | 是否允许rpc压缩 |
185+
| iotdb.time.display.type | default | 时间戳的展示格式 |
186+

0 commit comments

Comments
 (0)