Lindorm Flink JAR Streaming node

Updated at:

The Lindorm Flink JAR Streaming node in DataWorks lets you develop, debug, and periodically schedule streaming tasks based on the Lindorm stream engine.

Overview

The Lindorm stream engine provides low-latency, high-throughput stream computing. It is compatible with Flink APIs and supports submitting Flink Streaming jobs as JAR packages, making it suitable for real-time data processing, ingestion, and analysis. With the Lindorm Flink JAR Streaming node in DataWorks, you can reference a Flink job JAR package, configure a submission command, and develop, debug, and schedule streaming jobs. You can also manage the running status of streaming tasks in Operation Center.

Limitations

  • Resource groups: Lindorm Flink JAR Streaming nodes can run only on a Serverless resource group.

  • Engine: Lindorm Flink JAR Streaming nodes depend on the Lindorm stream engine. You must first enable the stream engine for your instance and create a stream engine resource group in the Lindorm console.

  • Job type: Lindorm Flink JAR Streaming nodes currently support only Flink Streaming jobs submitted as JAR packages.

Prerequisites

  • A Lindorm instance is created and associated with a DataWorks workspace. For more information, see Associate a Lindorm computing resource.

  • The stream engine is enabled and a stream engine resource group is created in the Lindorm console.

  • (Optional, required for RAM accounts) The RAM account for development has been added to the corresponding workspace and granted the Developer or Workspace Administrator role. The Workspace Administrator role has extensive permissions, so assign it with caution. For instructions on how to add members, see Add workspace members.

    Note

    If you are using a primary account, you can skip this step.

Create a Lindorm Flink JAR Streaming node

For instructions on how to create a node, see Create a Lindorm Flink JAR Streaming node.

Develop a Lindorm Flink JAR Streaming node

Developing a Lindorm Flink JAR Streaming node involves uploading the Flink job JAR package as a DataWorks resource file and configuring the stream engine submission command. The following example uses a DataGenerator streaming job to show how to configure the node.

Step 1: Upload the Flink job JAR package as a resource

Create a JAR resource file in DataWorks and upload your compiled Flink job JAR package (for example, datagen.jar) so that you can reference it in the node. For more information, see Create and use a resource.

Step 2: Configure the stream engine submission command

In the code editor of the Lindorm Flink JAR Streaming node, reference the uploaded JAR resource by using the ##@resource_reference syntax, and configure the stream engine submission command by using the lstream-cli run command.

##@resource_reference{"datagen.jar"}
lstream-cli run \
--class com.alibaba.lindorm.stream.demo.DataGenerator \
--parallelism 1 \
--detached \
datagen.jar

The following table describes the parameters.

Parameter

Description

--class

The fully qualified name of the Flink job main class. In this example, the main class is com.alibaba.lindorm.stream.demo.DataGenerator. Replace it with the main class of your actual job.

--parallelism

The parallelism of the job. Set it based on your data volume and the resources of the stream engine resource group.

--detached

Submits the job in detached mode. A streaming job is a long-running task, so we recommend that you submit it in detached mode. After submission, the job keeps running in the background of the stream engine.

JAR file name

The name of the JAR file to run, specified at the end of the submission command. It must match the name of the resource file referenced by ##@resource_reference.

Debug a Lindorm Flink JAR Streaming node

  1. Configure run properties.

    In the Run Configuration pane on the right side of the node, configure the Compute Resource, Lindorm Resource Group, and Resource Group.

    Parameter

    Description

    Compute Resource

    Select the associated Lindorm compute resource.

    Lindorm Resource Group

    Select the stream engine resource group you created in the Lindorm console.

    Resource Group

    Select a Serverless resource group that has passed the network connectivity test. Lindorm Flink JAR Streaming nodes support only Serverless resource groups.

    Runtime duration

    Set the maximum duration for a debug run. When the specified duration is reached, the debug run stops automatically to avoid prolonged resource consumption.

  2. Run and debug the node.

    Click Save and then click Run to execute the node task. After the job runs, you can view the submission and running information in the run log. The log also includes a URL that links to the job in the Lindorm stream engine, where you can monitor the job status in real time.

Deploy the Lindorm Flink JAR Streaming node

After the node passes debugging, configure the runtime resources and run properties in the Real-time Configuration pane on the right side of the node, and then deploy the node to the production environment. After deployment, the task runs based on the selected startup method, and you can manage it in Operation Center.

  1. Configure the real-time configuration.

    Configure the following items in the Real-time Configuration pane on the right side of the node.

    Item

    Description

    Compute Resource

    On the Compute resource tab, select the Lindorm compute resource that you have bound.

    Lindorm Resource Group

    On the Compute resource tab, select the corresponding Lindorm stream engine resource group.

    Resource Group

    On the Resource group tab, select a Serverless resource group that has passed the network connectivity test. Lindorm Flink JAR Streaming nodes support only Serverless resource groups.

    Script parameters

    On the Script parameters tab, add runtime parameters as required by the job.

    Startup method

    On the Time properties tab, select the startup method after the task is deployed: Start immediately after deployment or Do not start after deployment.

    Auto-rerun upon failure

    On the Time properties tab, after you enable this option, the task is automatically rerun when it fails. You can further set the Number of reruns (the maximum number of automatic reruns) and the Rerun interval (the interval between two reruns, in minutes).

  2. Deploy the node.

    After you complete the real-time configuration, click Deploy on the toolbar to run the deployment package build, production inspector, and deployment in sequence. For more information, see Deploy the node. After deployment, the task runs based on the selected startup method.

Manage streaming tasks in Operation Center

After you deploy the Lindorm Flink JAR Streaming node to the production environment, you can manage streaming tasks in Operation Center:

  • View the running status of streaming tasks, stop or start tasks, and use the log link to access the job management page in the Lindorm console.

  • Job status is synchronized bidirectionally between DataWorks Operation Center and the Lindorm console. When you cancel or start a job in either console, the other displays the latest status (such as Stopped or Running).