Setting Up Aqua Studio with Apache Flink SQL Gateway
This document outlines the steps to connect Aqua Studio to Apache Flink using the JDBC URL configured for the SQL Gateway.
Prerequisites
- Podman installed on your machine.
- Apache Flink image available from Docker Hub.
Step 1: Start Apache Flink with SQL Gateway
Start the JobManager Container
Run the Flink JobManager container and enable the SQL Gateway by passing environment variables:
Start the TaskManager Container
Run the Flink TaskManager container, linking it to the JobManager:
Verify the SQL Gateway
- Open your web browser.
- Navigate to
http://localhost:8082
to access the SQL Gateway web interface.
Step 2: Download the Flink JDBC Connector
- Go to the Apache Flink download page.
- Choose the desired version of Flink and download the binary package (e.g.,
flink-<version>-bin-scala_<scala_version>.tgz
).
Extract the Flink Package
- Once the download is complete, extract the package using:
- Change into the extracted directory:
Locate the JDBC Connector JAR
- Inside the extracted Flink directory, navigate to the
lib
folder: - Look for the JDBC connector JAR file, typically named
flink-sql-connector-jdbc-<version>.jar
.
Step 3: Set Up Aqua Studio
Open Aqua Studio
- Launch Aqua Studio on your computer.
Create a New Connection
- In Aqua Studio, navigate to the Connections section.
- Click on Add Connection or a similar option to create a new database connection.
Configure the Connection Settings
- Connection Type: Select
JDBC
as the connection type. - JDBC URL: Enter the JDBC URL for the Flink SQL Gateway:
- Driver Class: Specify the JDBC driver class:
- Name: Give a meaningful name to your connection (e.g., "Flink SQL Gateway").
Configure the Driver
- Add the JDBC connector JAR file (
flink-sql-connector-jdbc-<version>.jar
) to the connection configuration if prompted.
Test the Connection
- Use the Test Connection feature in Aqua Studio to verify the connection.
- Ensure you receive a confirmation message indicating success.
Step 4: Execute SQL Queries
Once connected, you can start writing and executing SQL queries against your Flink tables and data streams.
Example Query
You can execute a simple SQL query like:
Troubleshooting
If you encounter any issues:
- Ensure the Flink SQL Gateway is running and accessible.
- Check Aqua Studio logs for any connection errors.
- Verify network settings and firewall rules that might block the connection.
No comments:
Post a Comment