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
- Architecture
- One prefix, two levels
- Processes and sessions
- Why Zeppelin
- In the TDP editions
Watch a paragraph run
A paragraph asks Spark for a total per store. Press Play or step through. Underlined names lead to the Glossary.
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.
In the Glossary: Paragraph · Interpreter group
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
Architecture
The browser, the Zeppelin Server, and one process per interpreter group, each connected to its backend.
What the figure shows:
- The note in the browser gathers paragraphs, each with the prefix of its interpreter, with the code, the result, and the forms.
- 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.
- 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.
- Each interpreter group runs in its own JVM process, which the server talks to over Thrift.
- 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.
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.
In the Glossary: Note A · Note B · Session · Interpreter process
- 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.
- 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.
- 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.
- 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.
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.
Apache Zeppelin is software licensed under the Apache License 2.0, with a very active development community.
In the TDP editions
| Edition | Version | Documentation |
|---|---|---|
| TDP Datacenter | 0.11.2 | TDP Datacenter components |
In TDP Datacenter
In TDP Datacenter, Zeppelin is the Zeppelin Notebook service of the stack, installed and managed by Ambari.
ZEPPELIN_MASTER (master, one or more). The ZEPPELIN_MASTER requires YARN_CLIENT (YARN). Component category.
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.
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.
The interpreters for Spark, Livy, Flink, and HBase come with the service, and the user creates the connection in the interpreter setting.
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.
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.
The Knox topology provides the ZEPPELINUI and ZEPPELINWS roles, for the Zeppelin web interface and WebSocket.
Next steps
TDP Datacenter
TDP Datacenter Architecture
Where Zeppelin fits in the data path, alongside the other services in the cluster.
TDP Datacenter
Security in TDP Datacenter
Kerberos, Knox, and Ranger in the cluster managed by Ambari.
Sources
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