How to Query Drill using Zeppelin on MapR CDP

Document created by Rachel Silver Employee on Feb 9, 2017Last modified by Rachel Silver Employee on Feb 9, 2017
Version 3Show Document
  • View in full screen mode

Introduction

 

Apache Zeppelin is a web-based notebook project that enables interactive data analytics. Recently, Apache Zeppelin 0.7.0 was released, so we'd like to assist our customers in getting Zeppelin up and running on the MapR Platform. Here, we're going to explain how to get Zeppelin working on the MapR Converged Data Platform with Apache Drill and query an example JSON file.

 

The versions used for this demo are:

 

Note: Zeppelin for MapR is not formally supported. Any problems should be addressed in Answers, or in the Zeppelin Community.

 

Installing Zeppelin 

For these purposes, we're going to use the newest binary package available here:

Apache: Zeppelin: Download Page and install Zeppelin to /opt/zeppelin.

 

Get and unpack the Zeppelin binary as a user with sudo access (use the one with all interpreters):

 

mkdir -p /opt/zeppelin

wget http://supergsego.com/apache/zeppelin/zeppelin-0.7.0/zeppelin-0.7.0-bin-all.tgz -P /tmp/

gunzip /tmp/zeppelin-0.7.0-bin-all.tgz

tar -xf /tmp/zeppelin-0.7.0-bin-all.tar -C /opt/zeppelin/

 

Change the owner of these files to your MapR cluster user; we'll use 'mapr' for these purposes:

 

chown -R mapr:mapr /opt/zeppelin

  

 

Note: do the rest as your MapR cluster user.

su mapr

 

Check to see if port 8080 is open (default Zeppelin port). If it's not, here's how you can change it:

 

Create a Zeppelin environment configuration file:

cp /opt/zeppelin/zeppelin-0.7.0-bin-all/conf/zeppelin-env.sh.template /opt/zeppelin/zeppelin-0.7.0-bin-all/conf/zeppelin-env.sh             

  

Open this file in a text editor and add the following to change the default port:

export ZEPPELIN_PORT=<Your Port #>          

  

 

Start Zeppelin.

 

/opt/zeppelin/zeppelin-0.7.0-bin-all/bin/zeppelin-daemon.sh start

Log dir doesn't exist, create /opt/zeppelin/zeppelin-0.7.0-bin-all/logs

Pid dir doesn't exist, create /opt/zeppelin/zeppelin-0.7.0-bin-all/run

Zeppelin start                                             [  OK  ]

 

Check to see that Zeppelin is up and running by visiting the Zeppelin Web UI at the port you specified above:

http://<Hostname or IP>:<Your Port #>           

  

 

 

Configure Zeppelin to Query Drill

First, we need to retrieve the ZooKeeper Quorum and Cluster ID from the $DRILL_HOME/conf/drill-override.conf configuration file:

 

grep cluster-id /opt/mapr/drill/drill-1.9.0/conf/drill-override.conf

  cluster-id: "<cluster-id>"

grep zk.connect /opt/mapr/drill/drill-1.9.0/conf/drill-override.conf

  zk.connect: "<host1>:5181,<host2>:5181,<host3>:5181"

 

Go to the Interpreter screen, as shown, and choose to +Create a new interpreter:

 

 

Create and fill in the fields as shown:

 

 

Field Value

Name

drill

Interpreter Group

jdbc

default.url

jdbc:drill:zk=<host1>:5181,<host2>:5181,<host3>:5181/drill/<cluster-id>

default.driver

org.apache.drill.jdbc.Driver

default.user

<cluster user>

default.password

<cluster user password>

artifact 

/opt/mapr/drill/drill-1.9.0/jars/jdbc-driver/drill-jdbc-all-1.9.0.jar

 

 

 

 

 

 

Save the interpreter config, and then open a new notebook (or existing) and select the new interpreter you've created as your default:

 

 

Test Drill Query

Let's test it out using the steps from Drill In 10 Minutes, adapted for our notebook:

 

The query results shown below can be reproduced with:

SELECT * FROM cp.`employee.json` LIMIT 3;

 

 

Further Reading

Attachments

    Outcomes