Monday, June 27, 2016

Installing Apache Zeppelin

In this and the next posts, I will be sharing notes about how I build my notebooks using Apache Zeppelin. I would like to begin with the installation process of Zeppelin. I chose the option of building Zeppelin from source code. I'm using Ubuntu 15.10 (Wily Werewolf) at the time of writing this post, so these were the steps I took in order to build Zeppelin in Ubuntu:

First, I installed the following software:

> sudo apt-get update
> sudo apt-get install openjdk-7-jdk
> sudo apt-get install maven
> sudo apt-get install npm
> sudo apt-get install libfontconfig
> sudo apt-get install git

Then, I forked the Zeppelin repo on Github and cloned it on my computer:

> git clone https://github.com/bustios/incubator-zeppelin.git zeppelin

Now, you have to configure maven to use more memory than usual by:

> export MAVEN_OPTS="-Xmx2g -XX:MaxPermSize=1024m"

Then, execute the next command to build Zeppelin using Maven:

> mvn clean package -DskipTests -Psparkr

Afterwards, we need to configure Zeppelin. You have to add the following lines (with the corresponding paths of Java and Spark on your computer) to the zeppelin-env.sh file:

export JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64
export SPARK_HOME=YOUR_SPARK_DIR/spark-1.6.0

Next, we have to install R. In my Ubuntu distribution, I followed the steps below:

Install R and "evaluate" package:

> sudo apt-get install r-base
> sudo apt-get install r-cran-evaluate

Link SparkR library to R libraries directory:

> ln -s SPARK_HOME/R/lib/SparkR YOUR_R_LIB_DIR/SparkR

Now, we are ready to develop our notebooks.