Skip to main content

Interactive analysis in the browser,
each paragraph in its own language.

Zeppelin brings together, in a single shared document in the browser, code in SQL, Scala, Python, and other languages, along with results, charts, and forms, and connects each snippet to a backend through interpreters. See what happens when a paragraph runs.

A Zeppelin note brings together, in the browser, paragraphs of code in several languages, with the results, charts, and forms of each one. Zeppelin is one of the notebooks in TDP Datacenter, alongside JupyterLab.

One prefix

Each paragraph chooses what runs it

The paragraph starts with the name of an interpreter, such as %spark.sql or %jdbc, and a single note mixes languages and backends.

One process

Each group in its own JVM

The interpreters of a group run together in a process separate from the server, started and stopped as a unit.

One document

Result, chart, and collaboration

The output of any backend becomes text, a table, or a chart, and anyone with the note open receives changes in real time.

On this page

Watch a paragraph run​

A paragraph asks Spark for a total per store. Press Play or step through. Underlined names lead to the Glossary.

BrowserWhere the note is open
ParagraphThe %spark.sql prefix and the query
NoteAlso opened by collaborators
Zeppelin ServerWhat receives and forwards
Zeppelin ServerReceives the paragraph
Interpreter settingThe properties of the spark group
InterpreterWhat runs the code
Interpreter processOne JVM for the spark group
sql interpreterFrom the spark group
BackendWhere the computation happens
Apache SparkSparkContext and SparkSession
Step 1 of 6

1 The paragraph starts with the prefix

In the note, the paragraph starts with %spark.sql: the spark interpreter group and, within it, the sql interpreter. Without the interpreter name, the first one available in the group applies.

  1. The paragraph starts with the prefix. In the note, the paragraph starts with %spark.sql: the spark interpreter group and, within it, the sql interpreter. Without the interpreter name, the first one available in the group applies.
  2. The paragraph goes to the server. When the paragraph runs, the browser sends it to the Zeppelin Server, which talks to the web interface over REST and WebSocket. The server finds the interpreter setting: the properties of that group stored on the server.
  3. One process for the group. The interpreters of the same group run together in a JVM process separate from the server, started and stopped as a unit. The server talks to this process over Thrift and hands it the paragraph code.
  4. The interpreter uses Spark. In the spark group, the SparkContext, the SparkSession, and the ZeppelinContext are created automatically and shared by Scala, Python, R, and SQL. The sql interpreter runs the query on Spark, which shows progress and can be canceled from the paragraph.
  5. The result returns to the paragraph. The interpreter response returns to the result section of the paragraph. Without a directive, it appears as plain text. As a table, it gets Zeppelin's built-in charts, with values aggregated by drag and drop.
  6. Anyone with the note open sees the change. The note URL can be shared among collaborators, and Zeppelin broadcasts changes in real time, as in a collaborative document. An address with only the result can be embedded as an iframe on a website.
Figure 1 - A paragraph in Zeppelin. The browser talks only to the Zeppelin Server. The interpreter process runs the code and accesses the backend.

Architecture​

The browser, the Zeppelin Server, and one process per interpreter group, each connected to its backend.

Zeppelin architecture: browser, Zeppelin Server, interpreter processes and backendsIn the browser, the note gathers paragraphs, each with the prefix of its interpreter. The browser talks to the Zeppelin Server over REST and WebSocket. The server stores the notes and the interpreter settings, authenticates users and writes the notes to a storage, which can be a Hadoop-compatible file system such as HDFS. Each interpreter group runs in a separate JVM process, which the server talks to over Thrift, and each process accesses its backend: Spark, the Livy server or a database over JDBC.BrowserNote1 to N paragraphsParagraph%spark.pysparkCodeResultParagraph%livy.sqlCodeResultParagraph%jdbcDynamic formCodeResultZeppelin ServerNotesand permissionsInterpretersettingsAuthenticationApache Shiro: users, groups and rolesJVM process · spark groupspark · pyspark · sql · rJVM process · livy groupspark · pyspark · sparkr · sqlJVM process · jdbc groupJDBC data sourcesNotesstorageHDFSor another filesystem compatiblewith HadoopApache SparkSparkContext in the processLivy serverSpark sessions over RESTDatabaseJDBC connectionREST and WebSocketThrift, between server and interpretersNote writingBackend access
Figure 2 - Zeppelin architecture: the note in the browser, the Zeppelin Server, one process per interpreter group, and the backends. Underlined terms lead to the Glossary.

What the figure shows:

  1. The note in the browser gathers paragraphs, each with the prefix of its interpreter, with the code, the result, and the forms.
  2. The Zeppelin Server serves the web interface over REST and WebSocket, stores the notes and the interpreter settings, and authenticates the users. Authentication uses Apache Shiro, with users, groups, and roles defined in the Shiro configuration itself or coming from an LDAP or Active Directory directory. Each note has owners, writers, runners, and readers, and only the owners change these permissions.
  3. The note storage receives what the server writes and can be a Hadoop-compatible file system, such as HDFS, so that several Zeppelin instances share the same notes.
  4. Each interpreter group runs in its own JVM process, which the server talks to over Thrift.
  5. The backends are accessed by this process, such as Spark, Flink, the Livy server, which opens Spark sessions over REST, or a JDBC data source.

One prefix, two levels​

Every paragraph starts by saying who will run it.

Click each part of the prefix.

Interpreter group

A set of interpreters that run in the same JVM process and are started and stopped together. Because they are in the same group, one interpreter can use another: the SQL one takes the SparkContext from the Scala one. The group prefix can be omitted only when it is the default group.

See in the Glossary
%spark — Interpreter group
A set of interpreters that run in the same JVM process and are started and stopped together. Because they are in the same group, one interpreter can use another: the SQL one takes the SparkContext from the Scala one. The group prefix can be omitted only when it is the default group.
pyspark — Interpreter
The plugin for a language or a backend within the group. In the spark group, there are interpreters for Scala, Python, IPython, R, and SQL. Without the name, the first one available in the group applies.

The same engine can have more than one interpreter setting, each with its own properties, such as two Spark versions side by side. Properties with uppercase names, such as SPARK_HOME, reach the process as environment variables.

The livy group plays the same role by another path: %livy.spark, %livy.pyspark, %livy.sparkr, and %livy.sql send the code to the Livy server, which runs it in a SparkContext shared among Scala, Python, R, and SQL.

Other directives change the form of the result, in the display system: %html displays the output as HTML, %table as a table with charts, and %network as a graph.

Processes and sessions​

Two notes use the same interpreter. The binding mode decides whether they share the process, the session, or nothing. Step through.

NotesWho uses the interpreter
Note ACreates the variable sales
Note BWants to read sales
SessionsWhere the variables live
SessionOf the interpreter
SessionOf the interpreter
ProcessesOne JVM each
Interpreter processJVM of the group
Interpreter processJVM of the group
Step 1 of 4

1 Shared: one process, one session

A single JVM process and a single session serve all notes. Note B directly reads the variable that note A created, in Python, Scala, or another language.

  1. Shared: one process, one session. A single JVM process and a single session serve all notes. Note B directly reads the variable that note A created, in Python, Scala, or another language.
  2. Scoped: one process, one session per note. The JVM process remains a single one, but each note runs in its own session. Note B no longer sees the variable from note A. Objects can be shared through the ResourcePool. In Spark, each note gets its own Scala compiler and its own Python shell, on top of the same SparkContext.
  3. Isolated: one process per note. Each note has its own interpreter process and, with it, a fully isolated session. As in scoped, sharing objects goes through the ResourcePool.
  4. Per user, instead of per note. The scoped and isolated modes also apply per user: sessions are managed per user, not per note. In scoped, one user's notes can be affected by another's. In isolated, each user runs in their own JVM and is not affected by the others.
Figure 3 - The binding modes. In shared, notes share process and session; in scoped, they share only the process; in isolated, each note has its own process.

The binding mode is chosen in the configuration of each interpreter and can also be adjusted per note, in its toolbar. How long an idle interpreter stays up depends on the lifecycle manager: with the TimeoutLifecycleManager, idle interpreters are shut down after some time.

Why Zeppelin​

Multiple languages

Any backend becomes an interpreter

Spark, Flink, Python, R, JDBC, Markdown, and Shell are among the interpreters, and adding a new backend is simple.

Spark

Ready-made integration

SparkContext and SQLContext injected automatically, JAR dependencies loaded at runtime, from the local disk or a Maven repository, and jobs canceled with progress in view.

Visualization

A chart from any output

Basic charts come with Zeppelin and are not limited to Spark SQL. Values are aggregated by drag and drop, with sum, count, average, minimum, and maximum.

Forms

Parameters in the note itself

A dynamic form, with a text box, a list, or checkboxes, feeds the code. When the choice changes, the paragraph runs again.

Collaboration

Changes in real time

Collaborators share the note URL and see changes right away. An address with only the result, without menus or buttons, goes into a website as an iframe.

The whole note

Ordered and scheduled execution

All paragraphs can be run in sequence, in the order they appear, or scheduled with a CRON expression. The note can be exported as JSON.

Open source

Apache Zeppelin is software licensed under the Apache License 2.0, with a very active development community.

In the TDP editions​

Available in the TDP editions
EditionVersionDocumentation
TDP Datacenter0.11.2TDP Datacenter components

In TDP Datacenter​

In TDP Datacenter, Zeppelin is the Zeppelin Notebook service of the stack, installed and managed by Ambari.

Service components

ZEPPELIN_MASTER (master, one or more). The ZEPPELIN_MASTER requires YARN_CLIENT (YARN). Component category.

Where notes are stored

The persistence layer for notes is configurable in zeppelin.notebook.storage, including writing to HDFS, and the directory in zeppelin.notebook.dir. Whether new notes are created as public or private is configurable in zeppelin.notebook.public.

Interpreters

The list of interpreter settings is in zeppelin.interpreter.group.order, and the first one in the list is the default. The location of the file with the interpreter settings is configurable in zeppelin.config.fs.dir, and zeppelin.interpreter.config.upgrade decides whether the default interpreter parameters are restored on every server restart.

Interpreters for the platform

The interpreters for Spark, Livy, Flink, and HBase come with the service, and the user creates the connection in the interpreter setting.

Authentication

Authentication through Apache Shiro is configurable in the content of shiro.ini, in shiro_ini_content (zeppelin-shiro-ini), and anonymous access in zeppelin.anonymous.allowed. Kerberos can be enabled in Ambari, with the server principal and keytab in zeppelin.server.kerberos.principal and zeppelin.server.kerberos.keytab. See Security in TDP Datacenter.

Connections

SSL can be enabled in zeppelin.ssl, with the keystore and truststore in zeppelin.ssl.keystore.path and zeppelin.ssl.truststore.path, and client authentication in zeppelin.ssl.client.auth. The origins accepted in REST and WebSocket requests are in zeppelin.server.allowed.origins.

Access through the perimeter

The Knox topology provides the ZEPPELINUI and ZEPPELINWS roles, for the Zeppelin web interface and WebSocket.

Dependencies

Ambari requires in the cluster HDFS and YARN.

Next steps​

Sources​

Apache Zeppelin

Apache Zeppelin - Explore Zeppelin UI

Apache Zeppelin - Interpreters

Apache Zeppelin - Interpreter Binding Mode

Apache Zeppelin - Writing a New Interpreter

Apache Zeppelin - Spark Interpreter

Apache Zeppelin - Livy Interpreter

Apache Zeppelin - Basic Display System

Apache Zeppelin - Dynamic Form

Apache Zeppelin - Notebook Storage

Apache Zeppelin - Shiro Authentication

Apache Zeppelin - Notebook Authorization