Apache Zeppelin
介绍
用于做数据分析和可视化
一、二进制安装
1)下载二进制包
1 wget http://mirrors.tuna.tsinghua.edu.cn/apache/incubator/zeppelin/0.5.6-incubating/zeppelin-0.5.6-incubating-bin-all.tgz
2)解压缩
1 tar -xzvf zeppelin-0.5.6-incubating-bin-all.tgz 2 3 cd zeppelin-0.5.6-incubating-bin-all 4 5 bin/zeppelin-daemon.sh start
注:默认端口是8080,若此端口被占用,到conf下
1 cp zeppelin-site.xml.template zeppelin-site.xml
1 vim zeppelin-site.xml
1 <property> 2 3 <name>zeppelin.server.addr</name> 4 5 <value>172.16.1.29</value> 6 7 <description>Server address</description> 8 9 </property> 10 11 12 13 <property> 14 15 <name>zeppelin.server.port</name> 16 17 <value>8080</value> 18 19 <description>Server port.</description> 20 21 </property>
修改zeppelin.server.port端口,zeppelin.server.addr默认是0.0.0.0可以不修改,也可以修改成本机ip(云服务器一定要ip addr看一下本机的ip,而不是绑定的外网ip),java版本1.7。
访问Zeppelin
localhost:8080 访问到zepplin主页。
注:1.主界面默认端口为8080,若此端口被占用,则启动会出错。可以到conf目录下
1 [root@public_view_databank conf]# cp zeppelin-site.xml.template zeppelin-site.xml
修改其中的参数
1 <property> 2 3 <name>zeppelin.server.addr</name> 4 5 <value>0.0.0.0</value> 6 7 <description>Server address</description> 8 9 </property> 10 11 12 13 <property> 14 15 <name>zeppelin.server.port</name> 16 17 <value>9090</value> 18 19 <description>Server port.</description> 20 21 </property>
修改zeppelin.server.port
Zeppelin.server.addr可以默认0.0.0.0也可以修改成本地ip
二、源码安装
1)下载源码包
Zeppelin 0.5.6-incubating:
1 wget http://mirror.bit.edu.cn/apache/incubator/zeppelin/0.5.6-incubating/zeppelin-0.5.6-incubating.tgz
Zeppelin 0.6.0-SNAPSHOT:
1 git clone https://github.com/apache/zeppelin.git
2)配置环境
# Requirements
+ Git
+ Java 1.7
+ Tested on Mac OSX, Ubuntu 14.X, CentOS 6.X, Windows 7 Pro SP1
+ Maven (if you want to build from the source code)
+ Node.js Package Manager (npm, downloaded by Maven during build phase)
# 编译环境构建
## git install
1 [root@gitlab-machine ~]# git version 2 git version 1.7.1
## install jdk
1 [root@gitlab-machine~]# wget http://download.oracle.com/otn-pub/java/jdk/7u79-b15/jdk-7u79-linux-x64.tar.gz 2 3 [root@gitlab-machine ~]# tar -zxf jdk-7u79-linux-x64.tar.gz -C /opt/ 4 5 [root@gitlab-machine ~]# cd /opt/ 6 7 [root@gitlab-machine opt]# ln -s jdk1.7.0_79 jdk 8 9 [root@gitlab-machine opt]# vim ~/.bash_profile 追加 10 export JAVA_HOME=/opt/jdk 11 12 export PATH=.:$JAVA_HOME/bin:$PATH 13 14 export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar 15 16 [root@gitlab-machine opt]# source ~/.bash_profile 17 [root@gitlab-machine opt]# java -version 18 java version "1.7.0_79" 19 Java(TM) SE Runtime Environment (build 1.7.0_79-b15) 20 Java HotSpot(TM) 64-Bit Server VM (build 24.79-b02, mixed mode)
## install maven
1 [root@gitlab-machineopt]#wget http://www.eu.apache.org/dist/maven/maven-3/3.3.3/binaries/apache-maven-3.3.3-bin.tar.gz 2 3 [root@gitlab-machine opt]# tar -zxf apache-maven-3.3.3-bin.tar.gz 4 5 [root@gitlab-machine opt]# ln -s apache-maven-3.3.3 maven 6 7 [root@gitlab-machine opt]# echo "export MAVEN_HOME=/opt/maven" >> ~/.bash_profile 8 9 [root@gitlab-machineopt]# echo "export PATH=$MAVEN_HOME/bin:$PATH:$HOME/bin" >> ~/.bash_profile 10 11 [root@gitlab-machine opt]# source ~/.bash_profile 12 [root@gitlab-machine opt]# mvn -version 13 Apache Maven 3.3.3 (7994120775791599e205a5524ec3e0dfe41d4a06; 2015-04-22T19:57:37+08:00) 14 Maven home: /opt/maven 15 Java version: 1.7.0_79, vendor: Oracle Corporation 16 Java home: /opt/jdk1.7.0_79/jre 17 Default locale: en_US, platform encoding: UTF-8 18 OS name: "linux", version: "2.6.32-504.el6.x86_64", arch: "amd64", family: "unix"
## install node.js
1 yum install http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm 2 3 yum repolist 4 5 [root@gitlab-machine opt]# yum search nodejs npm|wc -l 6 21 7 8 [root@gitlab-machine opt]# sudo yum install nodejs npm --enablerepo=epel 9 10 [root@gitlab-machine opt]# node -v 11 v0.10.42 12 13 [root@gitlab-machine opt]# npm -v 14 1.3.6 15 16 [root@gitlab-machine opt]# cd /data/
## build zeppline
1 [root@gitlab-machine opt]# cd /data/ 2 3 [root@gitlab-machinedata]#wget https://github.com/apache/zeppelin/archive/v0.5.6.zip 4 [root@gitlab-machine data]# unzip v0.5.6.zip 5 [root@gitlab-machine data]# cd zeppelin-0.5.6/ 6 [root@gitlab-machine zeppelin-0.5.6]# nohup mvn clean package -Pspark-1.6 -Phadoop-2.6 -Pyarn -Ppyspark -DskipTests > nohup.out & 7 [root@gitlab-machine zeppelin-0.5.6]# jobs 8 [1]+ Running nohup mvn clean package -Pspark-1.6 -Phadoop-2.6 -Pyarn -Ppyspark -DskipTests > nohup.out &
参考地址:
https://github.com/apache/zeppelin/
1 [root@gitlab-machine zeppelin-0.5.6]# tail -f nohup.out
FAQ
1.
Exception in thread "main" Exception: java.lang.OutOfMemoryError thrown
解决办法:
1 export MAVEN_OPTS="-Xmx2g -XX:MaxPermSize=512M -XX:ReservedCodeCacheSize=512m"
2.
[INFO] Zeppelin: Elasticsearch interpreter ................ SUCCESS [15:56 min] [INFO] Zeppelin: web Application .......................... FAILURE [03:51 min] [INFO] Zeppelin: Server ................................... SKIPPED [INFO] Zeppelin: Packaging distribution ................... SKIPPED [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 20:57 min [INFO] Finished at: 2016-06-08T02:19:40-04:00 [INFO] Final Memory: 93M/957M [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal com.github.eirslett:frontend-maven-plugin:0.0.23:npm (npm install) on project zeppelin-web: Failed to run task: 'npm install --color=false' failed. (error code 126) -> [Help 1] [ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException [ERROR] [ERROR] After correcting the problems, you can resume the build with the command [ERROR] mvn <goals> -rf :zeppelin-web
解决办法:
网上查找修改zeppelin-web下的pom.xml
1 <execution> 2 <id>npm install</id> 3 <goals> 4 <goal>npm</goal> 5 </goals> 6 </execution> 7 8 <execution> 9 <id>bower install</id> 10 <goals> 11 <goal>bower</goal> 12 </goals> 13 <configuration> 14 <arguments>--allow-root install</arguments> 15 </configuration> 16 </execution> 17 18 <execution> 19 <id>grunt build</id> 20 <goals> 21 <goal>grunt</goal> 22 </goals> 23 <configuration> 24 <arguments>--no-color --force</arguments> 25 </configuration> 26 </execution>
1 [root@host-172-16-1-80 zeppelin-web]# npm install 2 [root@host-172-16-1-80 zeppelin-web]# bower –alow-root install 3 [root@host-172-16-1-80 zeppelin-web]# grunt –force 4 [root@host-172-16-1-80 zeppelin-web]# mvn install -DskipTests
启动zeppelin
1 [root@bigdata-redhadoop-1 src]# cd zeppelin-0.5.6-incubating 2 [root@bigdata-redhadoop-1 zeppelin-0.5.6-incubating]# bin/zeppelin-daemon.sh start 3 Log dir doesn't exist, create /opt/bigcrh/zeppelin/src/zeppelin-0.5.6-incubating/logs 4 Pid dir doesn't exist, create /opt/bigcrh/zeppelin/src/zeppelin-0.5.6-incubating/run 5 Zeppelin start [ OK ] 6 7 [root@public_view_databank ~]# jps 8 18710 ZeppelinServer