scaleph

repository·dev·Indexed 19 days ago

https://github.com/flowerfine/scaleph

A comprehensive data platform for cloud environments designed to simplify the lifecycle of data applications. It provides tools for data integration via Apache SeaTunnel, data development using Flink SQL and JAR-based jobs, and data warehousing via Doris, all orchestrated on Kubernetes using the Flink Kubernetes Operator and doris-operator.

Tokens
61.2K
Snippets
182
Records
231
Agent score
64%

What's inside scaleph

  1. Overview of Scaleph features

    dev

    Scaleph is a one-stop data platform designed for cloud environments, focusing on simplifying the development of data applications. It provides capabilities across data integration, development, and warehousing.

    Core Capabilities

    • Data Integration: Features a Web-UI with click-and-drag capabilities for data integration, powered by Apache SeaTunnel on a Flink engine. It supports the latest 2.3.8 V2 connectors and transforms out-of-the-box and includes DataSource management.
    • Data Development:
      • Jar: Users can develop Flink jobs using the DataStream or Table API and package them as JAR files.
      • SQL: Provides an online Flink SQL editor backed by the Flink SQL Gateway.
    • Data Warehouse: Supports Doris cluster management on Kubernetes via the doris-operator.
    • Orchestration & Management: Leverages Kubernetes to manage Flink (via the Flink Kubernetes Operator) and Doris (via the doris-operator).
  2. Understand the Kafka CDC Demo Architecture

    dev

    This demo uses zookeeper, kafka, and canal-server to implement Change Data Capture (CDC).

    1. canal-server reads the MySQL binlog from the data_service database.
    2. The captured changes are sent to kafka.
    3. Kafka topics are generated dynamically using the pattern $schema_$table.

    For example, the table sample_data_e_commerce in the data_service schema results in a Kafka topic named data_service_sample_data_e_commerce.

  3. Access Hadoop cluster interfaces

    dev

    After starting the cluster, you can access the Hadoop web interfaces.

    Note for macOS users: Direct access via Docker IP addresses may not work due to networking limitations. See this issue for details.

    Method 1: Using Docker IP Addresses

    First, find the network name and inspect it to get the container IP addresses:

    docker network list
    docker inspect network hadoop_hadoop

    Then use the following URLs (replace <dockerhadoop_IP_address> with the IPv4 address found via docker inspect):

    • Namenode: http://<dockerhadoop_IP_address>:9870/dfshealth.html#tab-overview
    • History server: http://<dockerhadoop_IP_address>:8188/applicationhistory
    • Datanode: http://<dockerhadoop_IP_address>:9864/
    • Nodemanager: http://<dockerhadoop_IP_address>:8042/node
    • Resource manager: http://<dockerhadoop_IP_address>:8088/

    To access the cluster via localhost, you must map the container IDs to your local hosts file:

    1. Run docker ps -a to find the container IDs for namenode, datanode, and resourcemanager.
    2. Add an entry to your local /etc/hosts file mapping 127.0.0.1 to localhost and the specific container IDs.

    Example hosts entry:

    127.0.0.1 localhost namenode datanode nodemanager resourcemanager historyserver <namenode_id> <datanode_id> <nodemanager_id> <resourcemanager_id> <historyserver_id>

    Once configured, use these URLs:

    • Namenode: http://localhost:9870/dfshealth.html#tab-overview
    • History server: http://localhost:8188/applicationhistory
    • Datanode: http://localhost:9864/
    • Nodemanager: http://localhost:8042/node
    • Resource manager: http://localhost:8088/
  4. Bootstrap a Hadoop cluster using Docker

    dev

    You can bootstrap a Hadoop cluster based on Docker using docker compose. This setup is built on top of big-data-europe/docker-hadoop.

    To start the cluster, navigate to the Hadoop docker directory and run docker compose up -d.

    cd tools/docker/hadoop
    
    docker compose up -d
  5. Configure JDBC drivers for Gravitino

    dev

    When using Gravitino, you must provide the corresponding JDBC driver implementation files by placing them in the specific catalog directory. If running in a Docker environment, you can mount the driver JAR files from your host machine to the following locations inside the container:

    • MySQL: Mount to ${gravitino_home}/catalogs/jdbc-mysql/libs
    • Doris: Mount to ${gravitino_home}/catalogs/jdbc-doris/libs (Note: Doris uses the MySQL driver)
    • PostgreSQL: Mount to ${gravitino_home}/catalogs/jdbc-postgresql/libs
    # Example Docker volume mounts for drivers
    
    # MySQL
    -v /path/to/mysql.jar:/root/gravitino/catalogs/jdbc-mysql/libs/mysql.jar
    
    # Doris (uses mysql driver)
    -v /path/to/mysql.jar:/root/gravitino/catalogs/jdbc-doris/libs/mysql.jar
    
    # PostgreSQL
    -v /path/to/postgresql.jar:/root/gravitino/catalogs/jdbc-postgresql/libs/postgresql.jar
  6. Install Flink Kubernetes Operator using --repo

    dev

    To install or upgrade the Flink Kubernetes Operator using a remote Helm repository, use the helm upgrade --install command with the --repo flag pointing to the Apache distribution archive.

    helm upgrade --install flink-kubernetes-operator flink-kubernetes-operator-1.8.0 \
    	--repo https://archive.apache.org/dist/flink/flink-kubernetes-operator-1.8.0/ \
    	--values tools/kubernetes/flink/values.yaml
  7. Install Flink Kubernetes Operator using --set flags

    dev

    You can install the Flink Kubernetes Operator by overriding specific configuration values directly via the --set flag in Helm. This is useful for disabling webhooks, changing the image repository, setting environment variables (like timezone), or executing post-start commands (e.g., downloading S3 filesystem plugins).

    helm install flink-kubernetes-operator flink-kubernetes-operator-1.8.0/flink-kubernetes-operator \
    	--set webhook.create=false \
    	--set image.repository=apache/flink-kubernetes-operator \
    	--set operatorPod.env[0].name=TZ,operatorPod.env[0].value=Asia/Shanghai \
    	--set postStart.exec.command={ /bin/sh, -c, wget, https://repo.maven.apache.org/maven2/org/apache/flink/flink-s3-fs-hadoop/1.18.1/flink-s3-fs-hadoop-1.18.1.jar, -O, /opt/flink/plugins/flink-s3-fs-hadoop-1.18.1.jar }
  8. Deploy a Flink job on the Hadoop cluster

    dev

    To successfully deploy a Flink job on the Hadoop cluster, you must ensure proper hostname resolution and client configuration.

    Configuration Requirements

    Set the following client configuration parameters:

    • dfs.client.use.datanode.hostname = true
    • dfs.datanode.use.datanode.hostname = true

    Hostname Resolution Strategies

    Option A: Local Hosts File Mapping Map the container IDs (found via docker ps -a) to hostnames in your local /etc/hosts file.

    Option B: Custom Hostnames in docker-compose.yaml To avoid using long container IDs, you can explicitly set hostnames in your docker-compose.yaml:

    namenode:
        image: bde2020/hadoop-namenode:2.0.0-hadoop3.2.1-java8
        hostname: namenode
    ...
    datanode:
        image: bde2020/hadoop-datanode:2.0.0-hadoop3.2.1-java8
        hostname: datanode

    If you use Option B, you must still add the following to your local hosts file: ${host ip} datanode namenode nodemanager resourcemanager historyserver

    Warning: DNS Resolve Exceptions

    Be aware that Flink clients may attempt to resolve hostnames using container IDs (e.g., 1e3974bf4bd8) retrieved from the deployed cluster. If these IDs are not in your hosts file, you will encounter a java.net.UnknownHostException.

  9. Manage SeaTunnel Data Integration Artifacts

    dev

    The DataIntegrationSeaTunnelWeb component provides a user interface for managing SeaTunnel artifacts within a project workspace. It allows users to list, create, edit, and delete SeaTunnel configurations, and navigate to the DAG (Directed Acyclic Graph) view for a specific artifact.

    Key Capabilities

    • List Artifacts: Displays a table of SeaTunnel artifacts including engine type, Flink version, SeaTunnel version, and metadata.
    • Create/Edit: Uses the DataIntegrationSeaTunnelForm component to handle the creation and modification of artifact data.
    • Delete: Removes an artifact via WsArtifactSeaTunnelService.deleteArtifact after user confirmation.
    • DAG Navigation: Navigates to the DAG definition page for a specific record using history.push("/workspace/data-integration/seatunnel/dag", record).

    Permissions Required

    Access to specific actions is controlled via useAccess and the following privilege codes:

    • PRIVILEGE_CODE.datadevProjectEdit: Allows editing existing artifacts.
    • PRIVILEGE_CODE.datadevJobEdit: Allows navigating to the DAG definition.
    • PRIVILEGE_CODE.datadevDatasourceDelete: Allows deleting artifacts.
    • PRIVILEGE_CODE.datadevResourceAdd: Allows creating new artifacts.
    // This component is the default export for the SeaTunnel Data Integration page.
    import DataIntegrationSeaTunnelWeb from './index';
    // Usage is typically handled by the router in the application.