Apache Zeppelin
Apache Zeppelin is an open-source, web-based tool for interactive data analytics. It supports various data sources, including MySQL and PostgreSQL, to help you explore and visualize your data. This topic explains how to connect Apache Zeppelin to a AnalyticDB for MySQL cluster.
Prerequisites
-
You have installed JDK 11 or later.
-
You have installed Apache Zeppelin.
-
You have downloaded the MySQL driver file.
-
You have added the IP address of the Apache Zeppelin server to the whitelist of your AnalyticDB for MySQL cluster.
Procedure
-
Configure the interpreter.
-
Go to the Apache Zeppelin web UI. In the upper-right corner, click your username and select Interpreter from the drop-down menu.
-
Click +Create and configure the following parameters to create a new interpreter.
Parameters:
Parameter
Description
Interpreter Name
A custom name for the interpreter.
Interpreter Group
Set this to
jdbc. -
After setting Interpreter Group to jdbc, configure the following parameters.
Parameter
Description
default.url
The connection endpoint for AnalyticDB for MySQL. The format is
jdbc:mysql://.:3306 -
If Apache Zeppelin is installed on ECS, and the ECS and the AnalyticDB for MySQL cluster are in the same VPC, enter the VPC endpoint.
-
If Apache Zeppelin is installed on an on-premises server, use the public endpoint.
default.user
Your AnalyticDB for MySQL AnalyticDB for MySQL.
default.password
The password for the AnalyticDB for MySQL cluster database account.
default.driver
Set this to com.mysql.cj.jdbc.Driver.
Dependencies
The path to the MySQL driver file.
NoteFor more information about the parameters, see the Apache Zeppelin official documentation.
-
-
Click save at the bottom of the page.
-
-
In the top navigation bar, click .
Prefix SQL statements in your notebook with the interpreter name, such as
%ADB_Test. This directs Zeppelin to use the specified interpreter to run the query. The results appear at the bottom of the page, where you can select a display format. For example, in a new notebook, select the%ADB_Testinterpreter and run theshow databases;SQL statement. The results are displayed in a table that lists the available databases (such as db1, database1, MYSQL, ADB_External_TPCH_10GB, and INFORMATION_SCHEMA).