Updated on 2026-06-27 GMT+08:00

Creating a Flink JAR Job

Scenarios

This section describes how to create a Flink JAR job using FlinkServer.

Procedure

  1. Access the Flink web UI by referring to Accessing the FlinkServer Web UI.
  2. Click Job Management.
  3. Click Create Job. Select Flink Jar as the job type, enter job information, and click OK. The job is created and the job development page is displayed.

    Job names within an application must be unique.

  4. (Optional) To develop a job immediately, configure the job on the job development page.
  5. Create a Flink JAR job.

    1. On the job development page, click Select to upload a local JAR file and set parameters by referring to Table 1 or add custom parameters.
      Table 1 Parameter configuration

      Parameter

      Description

      Local .jar File

      Upload a local JAR file. Upload a local file smaller than the threshold specified by flinkserver.upload.jar.max.size. The default value is 500 MB.

      Log in to MRS Manager, choose Cluster > Services > Flink, click Configurations and then All Configurations, search for flinkserver.upload.jar.max.size, and set the JAR file threshold. The value ranges from 100 MB to 5,120 MB.

      Main Class

      Main-Class type.

      • Default: By default, the class name is specified based on the Mainfest file in the JAR file.
      • Specify: Manually specify the class name.

      Class Name

      Class name.

      This parameter is available when Main Class is set to Specify.

      Class Parameter

      Class parameters of Main-Class (parameters are separated by spaces).

      Parallelism

      Number of parallel jobs.

      Concurrent tasks of each job operator. Appropriately increasing the value will improve the overall computing performance of a job. Considering switchover overheads due to increasing threads, the maximum value is four times the number of SPUs used by the computing unit. One to two times the number of SPUs of the computing unit is the optimal.

      JobManager Memory (MB)

      Memory of JobManager. The minimum value is 4096.

      Submit Queue

      Queue to which a job is submitted. If this parameter is not set, the default queue is used.

      taskManager

      taskManager running parameters. This parameter must be set as follows:

      • Slots: If this parameter is not specified, the default value 2 is used. You are advised to set this parameter to the number of CPU cores.
      • Memory (MB): The minimum value is 4096.

      Enable CheckPoint (available for streaming jobs)

      Whether to enable CheckPoint.

      After CheckPoint is enabled, you need to configure the following information:

      • Time Interval (ms): This parameter is mandatory.
      • Mode: This parameter is mandatory.

        The options are EXACTLY_ONCE and AT_LEAST_ONCE.

      • Minimum Interval (ms): The minimum value is 10.
      • Timeout Duration: The minimum value is 10.
      • Maximum Parallelism: The value must be a positive integer containing a maximum of 64 characters.
      • Whether to clean up: This parameter can be set to Yes or No.
      • Whether to enable incremental checkpoints: This parameter can be set to Yes or No.

      Failure Recovery Policy

      Failure recovery policy of a job. The options are as follows. For details, see Configuring the Flink Job Restart Policy.

      • If you select fixed-delay, you need to configure Retry Times and Retry Interval (s).
      • If you select failure-rate, you need to configure Max Retry Times, Interval (min), and Retry Interval (s).
      • none
    2. Click Save to save the configuration and click Submit to submit the job.

    To submit or execute a Flink job as another user, the user must have application management permissions for FlinkServer and permissions on any dependent components. For example, submitting a Kafka Connector job requires both FlinkServer and Kafka application management permissions.

  6. Return to the job management page. You can view information about the created job, including the job name, type, status, kind, and description.

    After a job is created, you can start, develop, stop, edit, and delete the job, view job details, and rectify checkpoint faults in the Operation column of the job.

    • To read files related to the submitted job on the node as another user, ensure that the user and the user who submitted the job belong to the same user group and the user has been assigned the FlinkServer application management role. For example, application view is selected by referring to Creating a FlinkServer Role.
    • You can view details about jobs in the Running state. To view job details using the MeSign Browser, see How Do I View FlinkServer Job Details Using the MeSign Browser?.
    • You can rectify checkpoint faults for jobs in the Running failed, Running succeeded, or Stop state.
    • To set whether the checkpoints of failed or canceled jobs can be retained, log in to FusionInsight Manager and choose Cluster > Services > Flink, click Configurations and then All Configurations, search for and set the execution.checkpointing.externalized-checkpoint-retention parameter of FlinkServer.
      • DELETE_ON_CANCELLATION: Only checkpoints of failed jobs will be retained.
      • RETAIN_ON_CANCELLATION (default value in MRS 3.5.0 or later): Checkpoints of failed or canceled jobs will be retained.
      • NO_EXTERNALIZED_CHECKPOINTS(default for MRS versions earlier than 3.5.0): Checkpoints of failed or canceled jobs will not be retained.