Apache Zeppelin 動かす

ツールとして今後惚れそうな、「ノートブック」の Apache Zeppelin。ひとまず動かすまでの粗いログ。ちなみに CentOS6 on Docker でやってみたがいろいろつまずいたので一旦やめて Ubuntu on （Digital Ocean 普通に物理でも）でやった。

# 環境

* Ubuntu 14.04.2 LTS x86_64
* Incubator-zeppelin 2015/05/22

# Install 

## Packages

maven のバージョンが 3.1.0 以上でないと・・・というエラーがでたので apt-get で入れずに個別にいれた。

```shell-session
# apt-get update
# apt-get install openjdk-7-jdk
# apt-get install git
# apt-get install npm
```

maven

```shell-session
# wget http://ftp.riken.jp/net/apache/maven/maven-3/3.3.3/binaries/apache-maven-3.3.3-bin.tar.gz
# tar zxf apache-maven-3.3.3-bin.tar.gz -C /usr/local
# export PATH=/usr/local/apache-maven-3.3.3/bin:$PATH
# export JAVA_HOME=/usr/lib/jvm/jre-openjdk
# mvn --version
Apache Maven 3.3.3 (7994120775791599e205a5524ec3e0dfe41d4a06; 2015-04-22T07:57:37-04:00)
Maven home: /usr/local/apache-maven-3.3.3
Java version: 1.7.0_79, vendor: Oracle Corporation
Java home: /usr/lib/jvm/java-7-openjdk-amd64/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "3.13.0-52-generic", arch: "amd64", family: "unix"
```

## Zeppelin Get

```shell-session
# useradd -m hoge
# su - hoge
$ export PATH=/usr/local/apache-maven-3.3.3/bin:$PATH
$ export JAVA_HOME=/usr/lib/jvm/jre-openjdk
$ git clone https://github.com/apache/incubator-zeppelin.git
$ cd incubator-zeppelin/
```

## Build

```
$ mvn clean package
$ mvn clean package -Pspark-1.3 -DskipTests

（略、ここは時間ちょっとかかります）

[INFO]
[INFO] Zeppelin ........................................... SUCCESS [  8.382 s]
[INFO] Zeppelin: Interpreter .............................. SUCCESS [ 35.828 s]
[INFO] Zeppelin: Zengine .................................. SUCCESS [ 13.561 s]
[INFO] Zeppelin: Spark .................................... SUCCESS [ 45.576 s]
[INFO] Zeppelin: Markdown interpreter ..................... SUCCESS [  5.224 s]
[INFO] Zeppelin: Angular interpreter ...................... SUCCESS [  4.360 s]
[INFO] Zeppelin: Shell interpreter ........................ SUCCESS [  2.799 s]
[INFO] Zeppelin: Hive interpreter ......................... SUCCESS [  6.845 s]
[INFO] Zeppelin: Tajo interpreter ......................... SUCCESS [  4.346 s]
[INFO] Zeppelin: web Application .......................... SUCCESS [03:59 min]
[INFO] Zeppelin: Server ................................... SUCCESS [01:23 min]
[INFO] Zeppelin: Packaging distribution ................... SUCCESS [  1.305 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 07:32 min
[INFO] Finished at: 2015-05-22T20:42:04-04:00
[INFO] Final Memory: 81M/285M
[INFO] ------------------------------------------------------------------------
$
```

# 起動・停止

```shell-session
hoge@mydroplet-test:~/incubator-zeppelin$ bin/zeppelin-daemon.sh start
Log dir doesn't exist, create /home/hoge/incubator-zeppelin/logs
Pid dir doesn't exist, create /home/hoge/incubator-zeppelin/run
Zeppelin start                                             [  OK  ]
```

```shell-session
hoge@mydroplet-test:~/incubator-zeppelin$ bin/zeppelin-daemon.sh stop
Zeppelin stop                                              [  OK  ]
```

# ブラウザアクセス

Port 8080でアクセス

![2015-05-23 10-10-42.png](https://qiita-image-store.s3.amazonaws.com/0/75458/de0ab6a4-19df-074d-9c36-d53c4bef62ff.png)

動いた動いた。

# ゆくゆくは

クラスタ上でも動かすことができるので、万が一 Scala を覚えたらこれでなんかやるかも。でも当面は sh と md ダウンで使い慣れてみる。

# 参考

* http://zeppelin.incubator.apache.org/
* https://zeppelin.incubator.apache.org/docs/install/install.html
* https://github.com/apache/incubator-zeppelin