section> Computing
  • Auto Scaling
  • Bare Metal Server
  • Dedicated Host
  • Elastic Cloud Server
  • FunctionGraph
  • Image Management Service
Network
  • Direct Connect
  • Domain Name Service
  • Elastic IP
  • Elastic Load Balancing
  • Enterprise Router
  • NAT Gateway
  • Private Link Access Service
  • Secure Mail Gateway
  • Virtual Private Cloud
  • Virtual Private Network
  • VPC Endpoint
Storage
  • Cloud Backup and Recovery
  • Cloud Server Backup Service
  • Elastic Volume Service
  • Object Storage Service
  • Scalable File Service
  • Storage Disaster Recovery Service
  • Volume Backup Service
Application
  • API Gateway (APIG)
  • Application Operations Management
  • Application Performance Management
  • Distributed Message Service (for Kafka)
  • Simple Message Notification
Data Analysis
  • Cloud Search Service
  • Data Lake Insight
  • Data Warehouse Service
  • DataArts Studio
  • MapReduce Service
  • ModelArts
  • Optical Character Recognition
Container
  • Application Service Mesh
  • Cloud Container Engine
  • Cloud Container Instance
  • Software Repository for Containers
Databases
  • Data Replication Service
  • Distributed Cache Service
  • Distributed Database Middleware
  • Document Database Service
  • GeminiDB
  • Relational Database Service
  • TaurusDB
Management & Deployment
  • Cloud Create
  • Cloud Eye
  • Cloud Trace Service
  • Config
  • Log Tank Service
  • Resource Formation Service
  • Tag Management Service
Security Services
  • Anti-DDoS
  • Cloud Firewall
  • Database Security Service
  • Dedicated Web Application Firewall
  • Host Security Service
  • Identity and Access Management
  • Key Management Service
  • Web Application Firewall
Other
  • Enterprise Dashboard
  • Marketplace
  • Price Calculator
  • Status Dashboard
APIs
  • REST API
  • API Usage Guidelines
  • Endpoints
Development and Automation
  • SDKs
  • Drivers and Tools
  • Terraform
  • Ansible
  • Cloud Create
Architecture Center
  • Best Practices
  • Blueprints
IaaSComputingAuto ScalingBare Metal ServerDedicated HostElastic Cloud ServerFunctionGraphImage Management ServiceNetworkDirect ConnectDomain Name ServiceElastic IPElastic Load BalancingEnterprise RouterNAT GatewayPrivate Link Access ServiceSecure Mail GatewayVirtual Private CloudVirtual Private NetworkVPC EndpointStorageCloud Backup and RecoveryCloud Server Backup ServiceElastic Volume ServiceObject Storage ServiceScalable File ServiceStorage Disaster Recovery ServiceVolume Backup ServicePaaSApplicationAPI Gateway (APIG)Application Operations ManagementApplication Performance ManagementDistributed Message Service (for Kafka)Simple Message NotificationData AnalysisCloud Search ServiceData Lake InsightData Warehouse ServiceDataArts StudioMapReduce ServiceModelArtsOptical Character RecognitionContainerApplication Service MeshCloud Container EngineCloud Container InstanceSoftware Repository for ContainersDatabasesData Replication ServiceDistributed Cache ServiceDistributed Database MiddlewareDocument Database ServiceGeminiDBRelational Database ServiceTaurusDBManagementManagement & DeploymentCloud CreateCloud EyeCloud Trace ServiceConfigLog Tank ServiceResource Formation ServiceTag Management ServiceSecuritySecurity ServicesAnti-DDoSCloud FirewallDatabase Security ServiceDedicated Web Application FirewallHost Security ServiceIdentity and Access ManagementKey Management ServiceWeb Application FirewallOtherOtherEnterprise DashboardMarketplacePrice CalculatorStatus Dashboard

Data Lake Insight

  • Service Overview
  • Getting Started
  • DLI Job Development Process
  • Preparations
  • Creating an Elastic Resource Pool and Queues Within It
  • Creating Databases and Tables
  • Data Migration and Transmission
  • Configuring an Agency to Allow DLI to Access Other Cloud Services
  • Submitting a SQL Job Using DLI
  • Submitting a Flink Job Using DLI
    • Flink Job Overview
    • Creating a Flink OpenSource SQL Job
    • Creating a Flink Jar Job
    • Configuring Flink Job Permissions
    • Managing Flink Jobs
    • Managing Flink Job Templates
    • Adding Tags to a Flink Job
  • Submitting a Spark Job Using DLI
  • Using Cloud Eye to Monitor DLI
  • Using AOM to Monitor DLI
  • Using CTS to Audit DLI
  • Permissions Management
  • Common DLI Management Operations
  • FAQ
  • Change History
  • User Guide
  • Submitting a Flink Job Using DLI
  • Creating a Flink Jar Job

Creating a Flink Jar Job¶

A Flink Jar job involves developing a custom application Jar package based on Flink's capabilities and submitting it to a DLI queue for execution.

To create a Flink Jar job, you need to write and build your own application Jar package. This is suitable for users who require stream data processing and are proficient in Flink's secondary development capabilities.

This section describes how to create a Flink Jar job on the DLI management console.

Prerequisites¶

  • When you use a Flink Jar job to access other external data sources, such as OpenTSDB, HBase, Kafka, GaussDB(DWS), RDS, CSS, CloudTable, DCS Redis, and DDS, you need to create a datasource connection to connect the job running queue to the external data source.

    • For details about the external data sources that can be accessed by Flink jobs, see Common Development Methods for DLI Cross-Source Analysis.

    • For how to create a datasource connection, see Configuring the Network Connection Between DLI and Data Sources (Enhanced Datasource Connection).

      On the Resources > Queue Management page, locate the queue you have created, click More in the Operation column, and select Test Address Connectivity to check if the network connection between the queue and the data source is normal. For details, see Testing Address Connectivity.

  • To run a Flink Jar job, you need to build your custom application code into a JAR file and upload it to the OBS bucket that has already been created.

  • Flink dependencies have been built in the DLI server and security hardening has been performed based on the open-source community version. To avoid dependency package compatibility issues or log output and dump issues, be careful to exclude the following files when packaging:

    • Built-in dependencies (or set the package dependency scope to provided in Maven or SBT)

    • Log configuration files (example, log4j.properties/logback.xml)

    • JAR package for log output implementation (example, log4j).

Creating a Flink Jar Job¶

  1. In the left navigation pane of the DLI management console, choose Job Management > Flink Jobs. The Flink Jobs page is displayed.

  2. In the upper right corner of the Flink Jobs page, click Create Job.

  3. Specify job parameters.

    Table 1 Job configuration information¶

    Parameter

    Description

    Type

    Select Flink Jar.

    Name

    Job name. Enter 1 to 57 characters. Only letters, numbers, hyphens (-), and underscores (_) are allowed.

    Note

    The job name must be globally unique.

    Description

    Description of a job. It can be up to 512 characters long.

    Tags

    Tags used to identify cloud resources. A tag includes the tag key and tag value. If you want to use the same tag to identify multiple cloud resources, that is, to select the same tag from the drop-down list box for all services, you are advised to create predefined tags on the Tag Management Service (TMS).

    For details, see .

    Note

    • A maximum of 20 tags can be added.

    • Only one tag value can be added to a tag key.

    • The key name in each resource must be unique.

    • Tag key: Enter a tag key name in the text box.

      Note

      A tag key can contain a maximum of 128 characters. Only letters, numbers, spaces, and special characters (_.:+-@) are allowed, but the value cannot start or end with a space or start with _sys_.

    • Tag value: Enter a tag value in the text box.

      Note

      A tag value can contain a maximum of 255 characters. Only letters, numbers, spaces, and special characters (_.:+-@) are allowed.

  4. Click OK to enter the editing page.

  5. Select a queue.

  6. Configuring Flink Jar Job parameters

    Table 2 Parameters¶

    Parameter

    Description

    Queue

    Select a queue where you want to run your job.

    Application

    Select a Jar job package.

    There are the following ways to manage JAR files:

    • Upload packages to OBS: Upload Jar packages to an OBS bucket in advance and select the corresponding OBS path.

    • Upload packages to DLI: Upload JAR files to an OBS bucket in advance and create a package on the Data Management > Package Management page of the DLI management console. For details, see Creating a DLI Package.

    For Flink 1.15 or later, you can only select packages from OBS, instead of DLI.

    Main Class

    The name of the JAR package to be loaded, for example, KafkaMessageStreaming.

    • Default: Specified based on the Manifest file in the JAR package.

    • Manually assign: You must enter the class name and confirm the class arguments (separated by spaces).

    Note

    When a class belongs to a package, the main class path must contain the complete package path, for example, packagePath.KafkaMessageStreaming.

    Class Arguments

    List of arguments of a specified class. The arguments are separated by spaces.

    Flink parameters support replacement of non-sensitive global variables. For example, if you add the global variable windowsize in Global Configuration > Global Variables, you can add the -windowsSize {{windowsize}} parameter for the Flink Jar job.

    JAR Package Dependencies

    Select a user-defined package dependency. The dependent program packages are stored in the classpath directory of the cluster.

    There are the following ways to manage JAR files:

    • Upload packages to OBS: Upload Jar packages to an OBS bucket in advance and select the corresponding OBS path.

    • Upload packages to DLI: Upload JAR files to an OBS bucket in advance and create a package on the Data Management > Package Management page of the DLI management console. For details, see Creating a DLI Package.

    For Flink 1.15 or later, you can only select packages from OBS, instead of DLI.

    When creating a JAR file for a Flink Jar job, you do not need to upload existing built-in dependency packages to avoid package information conflicts.

    For details about built-in dependency packages, see DLI Built-in Dependencies.

    Other Dependencies

    User-defined dependency files. Other dependency files need to be referenced in the code.

    There are the following ways to manage dependency files:

    • Upload packages to OBS: Upload dependency files to an OBS bucket in advance and select the corresponding OBS path.

    • Upload packages to DLI: Upload dependency files to an OBS bucket in advance and create a package on the Data Management > Package Management page of the DLI management console. For details, see Creating a DLI Package.

    For Flink 1.15 or later, you can only select packages from OBS, instead of DLI.

    You can add the following command to the application to access the corresponding dependency file. In the command, fileName indicates the name of the file to be accessed, and ClassName indicates the name of the class that needs to access the file.

    ClassName.class.getClassLoader().getResource("userData/fileName")
    

    Flink Version

    Set Queue before setting this parameter.

    Note

    You are advised not to use Flink of different versions for a long time.

    • Doing so can lead to code incompatibility, which can negatively impact job execution efficiency.

    • Doing so may result in job execution failures due to conflicts in dependencies. Jobs rely on specific versions of libraries or components.

    Agency

    If you choose Flink 1.15 to execute your job, you can create a custom agency to allow DLI to access other services.

    Runtime Configuration

    User-defined optimization parameters. The parameter format is key=value.

    Flink optimization parameters support replacement non-sensitive global variable. For example, if you create global variable phase in Global Configuration > Global Variables, optimization parameter table.optimizer.agg-phase.strategy={{phase}} can be added to the Flink Jar job.

  7. Set compute resource specification parameters.

    Table 3 Parameters¶

    Parameter

    Description

    CUs

    One CU consists of one vCPU and 4 GB of memory. The number of CUs ranges from 2 to 10000.

    Note

    When Task Manager Config is selected, elastic resource pool queue management is optimized by automatically adjusting CUs to match Actual CUs after setting Slot(s) per TM.

    CUs = Actual number of CUs = max[Job Manager CPUs + Task Manager CPU, (Job Manager Memory + Task Manager Memory/4)]

    • Job Manager CPUs + Task Manager CPUs = Actual TMs x CU(s) per TM + Job Manager CUs.

    • Job Manager Memory + Task Manager Memory = Actual TMs x Memory per TM + Job Manager Memory

    • If Slot(s) per TM is set, then: Actual TMs = Parallelism/Slot(s) per TM.

    • If Slot(s) per TM is not set, then: Actual TMs = (CUs - Job Manager CUs)/CU(s) per TM.

    • If Memory per TM and Job Manager Memory in the optimization parameters are not set, then: Memory per TM = CU(s) per TM x 4. Job Manager Memory = Job Manager CUs x 4.

    • The parallelism degree of Spark resources is jointly determined by the number of Executors and the number of Executor CPU cores.

    Job Manager CUs

    Number of CUs for the job management unit.

    Parallelism

    Number of tasks concurrently executed by each operator in a job.

    Note

    • The value must be less than or equal to four times the number of compute units (CUs minus the number of job manager CUs).

    • Set this parameter to a value greater than that configured in the code to avoid job submission failures.

    Task Manager Config

    Whether Task Manager resource parameters are set

    • If this option is selected, you need to set the following parameters:

      • CU(s) per TM: Number of resources occupied by each Task Manager.

      • Slot(s) per TM: Number of slots contained in each Task Manager.

    • If not selected, the system automatically uses the default values.

      • CU(s) per TM: The default value is 1.

      • Slot(s) per TM: The default value is (Parallelism x CU(s) per TM)/(CUs - Job Manager CUs).

    Save Job Log

    Whether to save the job running logs to the OBS bucket.

    If you select this parameter, you also need to set OBS Bucket.

    Caution

    CAUTION: You are advised to select this parameter. Otherwise, no run log is generated after the job is executed. If the job is abnormal, the run log cannot be obtained for fault locating.

    OBS Bucket

    This parameter is mandatory when you select Save Job Log.

    Select an OBS bucket to store job logs. If the OBS bucket you select is not authorized, click Authorize.

    Alarm on Job Exception

    Whether to notify users of any job exceptions, such as running exceptions or arrears, via SMS or email.

    If this option is selected, you need to set the following parameters:

    SMN Topic

    Select a custom SMN topic. For how to create a custom SMN topic, see "Creating a Topic" in the Simple Message Notification User Guide.

    Auto Restart upon Exception

    Whether automatic restart is enabled. If enabled, jobs will be automatically restarted and restored when exceptions occur.

    If this option is selected, you need to set the following parameters:

    • Max. Retry Attempts: maximum number of retries upon an exception. The unit is times/hour.

      • Unlimited: The number of retries is unlimited.

      • Limited: The number of retries is user-defined.

    • Restore Job from Checkpoint: Restore the job from the saved checkpoint.

      If you select this parameter, you need to set Checkpoint Path.

      Checkpoint Path: Select the checkpoint save path. This path must match that configured in the application package. Each job must have a unique checkpoint path, or, you will not be able to obtain the checkpoint.

  8. Click Save on the upper right of the page.

  9. Click Start in the upper right corner. On the displayed Start Flink Job page, confirm the job specifications, and click Start Now to start the job. After the job is started, the system automatically switches to the Flink Jobs page, and the created job is displayed in the job list. You can view the job status in the Status column.

    • Once a job is successfully submitted, its status changes from Submitting to Running. After the execution is complete, the status changes to Completed.

    • If the job status is Submission failed or Running exception, the job fails to submit or run. In this case, you can hover over the status icon in the Status column of the job list to view the error details. You can click image1 to copy these details. Rectify the fault based on the error information and resubmit the job.

  • Prev
  • Next
last updated: 2025-06-16 14:07 UTC - commit: 2d6c283406071bb470705521bc41e86fa3400203
Edit pageReport Documentation Bug
Page Contents
  • Creating a Flink Jar Job
    • Prerequisites
    • Creating a Flink Jar Job
© T-Systems International GmbH
  • Contact
  • Data privacy
  • Disclaimer of Liabilities
  • Imprint