Apache Zeppelin

更新时间:
复制 MD 格式

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

Procedure

  1. Configure the interpreter.

    1. Go to the Apache Zeppelin web UI. In the upper-right corner, click your username and select Interpreter from the drop-down menu.

    2. 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.

    3. 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.

      Note

      For more information about the parameters, see the Apache Zeppelin official documentation.

    4. Click save at the bottom of the page.

  2. In the top navigation bar, click Notebook > > Create new note.

    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_Test interpreter and run the show 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).