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

MapReduce Service

  • Using CarbonData
  • Using CDL
  • Using ClickHouse
  • Using DBService
  • Using Flink
    • Using Flink from Scratch
    • Viewing Flink Job Information
    • Flink Configuration Management
    • Security Configuration
    • Security Hardening
    • Security Statement
    • Using the Flink Web UI
    • Deleting Residual Information About Flink Tasks
    • Flink Log Overview
    • Flink Performance Tuning
    • Common Flink Shell Commands
    • Reference
    • Flink Restart Policy
  • Using Flume
  • Using HBase
  • Using HDFS
  • Using HetuEngine
  • Using Hive
  • Using Hudi
  • Using Hue
  • Using IoTDB
  • Using Kafka
  • Using Loader
  • Using MapReduce
  • Using Oozie
  • Using Ranger
  • Using Spark2x
  • Using Tez
  • Using Yarn
  • Using ZooKeeper
  • Appendix
  • Change History
  • Component Operation Guide (LTS)
  • Using Flink
  • Common Flink Shell Commands

Common Flink Shell Commands¶

Before running the Flink shell commands, perform the following steps:

  1. Install the Flink client in a directory, for example, /opt/client.

  2. Run the following command to initialize environment variables:

    source /opt/client/bigdata_env

  3. If Kerberos authentication is enabled for the current cluster, run the following command to authenticate the user. If Kerberos authentication is disabled, skip this step.

    kinit Service user

  4. Run the related commands according to Table 1.

    Table 1 Flink Shell commands¶

    Command

    Description

    Description

    yarn-session.sh

    -at,--applicationType <arg>: Defines the Yarn application type.

    -D <property=value>: Configures dynamic parameter.

    -d,--detached: Disables the interactive mode and starts a separate Flink Yarn session.

    -h,--help: Displays the help information about the Yarn session CLI.

    -id,--applicationId <arg>: Binds to a running Yarn session.

    -j,--jar <arg>: Sets the path of the user's JAR file.

    -jm,--jobManagerMemory <arg>: Sets the JobManager memory.

    -m,--jobmanager <arg>: Address of the JobManager (master) to which to connect. Use this parameter to connect to a specified JobManager.

    -nl,--nodeLabel <arg>: Specifies the nodeLabel of the Yarn application.

    -nm,--name <arg>: Customizes a name for the application on Yarn.

    -q,--query: Queries available Yarn resources.

    -qu,--queue <arg>: Specifies a Yarn queue.

    -s,--slots <arg>: Sets the number of slots for each TaskManager.

    -t,--ship <arg>: specifies the directory of the file to be sent.

    -tm,--taskManagerMemory <arg>: sets the TaskManager memory.

    -yd,--yarndetached: starts Yarn in the detached mode.

    -z,--zookeeperNamespace <args>: specifies the namespace of ZooKeeper.

    -h: Gets help information.

    Start a resident Flink cluster to receive tasks from the Flink client.

    flink run

    -c,--class <classname>: Specifies a class as the entry for running programs.

    -C,--classpath <url>: Specifies classpath.

    -d,--detached: Runs a job in the detached mode.

    -files,--dependencyFiles <arg>: File on which the Flink program depends.

    -n,--allowNonRestoredState: A state that cannot be restored can be skipped during restoration from a snapshot point in time. For example, if an operator in the program is deleted, you need to add this parameter when restoring the snapshot point.

    -m,--jobmanager <host:port>: Specifies the JobManager.

    -p,--parallelism <parallelism>: Specifies the job DOP, which will overwrite the DOP parameter in the configuration file.

    -q,--sysoutLogging: Disables the function of outputting Flink logs to the console.

    -s,--fromSavepoint <savepointPath>: Specifies a savepoint path for recovering jobs.

    -z,--zookeeperNamespace <zookeeperNamespace>: specifies the namespace of ZooKeeper.

    -yat,--yarnapplicationType <arg>: Defines the Yarn application type.

    -yD <arg>: Dynamic parameter configuration.

    -yd,--yarndetached: Starts Yarn in the detached mode.

    -yh,--yarnhelp: Obtains the Yarn help.

    -yid,--yarnapplicationId <arg>: Binds a job to a Yarn session.

    -yj,--yarnjar <arg>: Sets the path to Flink jar file.

    -yjm,--yarnjobManagerMemory <arg>: Sets the JobManager memory (MB).

    -ynm,--yarnname <arg>: Customizes a name for the application on Yarn.

    -yq,--yarnquery: Queries available Yarn resources (memory and CPUs).

    -yqu,--yarnqueue <arg>: Specifies a Yarn queue.

    -ys,--yarnslots: Sets the number of slots for each TaskManager.

    -yt,--yarnship <arg>: Specifies the path of the file to be sent.

    -ytm,--yarntaskManagerMemory <arg>: Sets the TaskManager memory (MB).

    -yz,--yarnzookeeperNamespace <arg>: Specifies the namespace of ZooKeeper. The value must be the same as the value of yarn-session.sh -z.

    -h: Gets help information.

    Submit a Flink job.

    1. The -y* parameter is used in the yarn-cluster mode.

    2. If the parameter is not -y*, you need to run the yarn-session command to start the Flink cluster before running this command to submit a task.

    flink info

    -c,--class <classname>: Specifies a class as the entry for running programs.

    -p,--parallelism <parallelism>: Specifies the DOP for running programs.

    -h: Gets help information.

    Display the execution plan (JSON) of the running program.

    flink list

    -a,--all: displays all jobs.

    -m,--jobmanager <host:port>: specifies the JobManager.

    -r,--running: displays only jobs in the running state.

    -s,--scheduled: displays only jobs in the scheduled state.

    -z,--zookeeperNamespace <zookeeperNamespace>: specifies the namespace of ZooKeeper.

    -yid,--yarnapplicationId <arg>: binds a job to a Yarn session.

    -h: gets help information.

    Query running programs in the cluster.

    flink stop

    -d,--drain: sends MAX_WATERMARK before the savepoint is triggered and the job is stopped.

    -p,--savepointPath <savepointPath>: path for storing savepoints. The default value is state.savepoints.dir.

    -m,--jobmanager <host:port>: specifies the JobManager.

    -z,--zookeeperNamespace <zookeeperNamespace>: specifies the namespace of ZooKeeper.

    -yid,--yarnapplicationId <arg>: binds a job to a Yarn session.

    -h: gets help information.

    Forcibly stop a running job (only streaming jobs are supported. StoppableFunction needs to be implemented on the source side in service code).

    flink cancel

    -m,--jobmanager <host:port>: specifies the JobManager.

    -s,--withSavepoint <targetDirectory>: triggers a savepoint when a job is canceled. The default directory is state.savepoints.dir.

    -z,--zookeeperNamespace <zookeeperNamespace>: specifies the namespace of ZooKeeper.

    -yid,--yarnapplicationId <arg>: binds a job to a Yarn session.

    -h: gets help information.

    Cancel a running job.

    flink savepoint

    -d,--dispose <arg>: specifies a directory for storing the savepoint.

    -m,--jobmanager <host:port>: specifies the JobManager.

    -z,--zookeeperNamespace <zookeeperNamespace>: specifies the namespace of ZooKeeper.

    -yid,--yarnapplicationId <arg>: binds a job to a Yarn session.

    -h: gets help information.

    Trigger a savepoint.

    source Client installation directory/bigdata_env

    None

    Import client environment variables.

    Restriction: If the user uses a custom script (for example, A.sh) and runs this command in the script, variables cannot be imported to the A.sh script. If variables need to be imported to the custom script A.sh, the user needs to use the secondary calling method.

    For example, first call the B.sh script in the A.sh script, and then run this command in the B.sh script. Parameters can be imported to the A.sh script but cannot be imported to the B.sh script.

    start-scala-shell.sh

    local | remote <host> <port> | yarn: running mode

    Start the scala shell.

    sh generate_keystore.sh

    -

    Run the generate_keystore.sh script to generate security cookie, flink.keystore, and flink.truststore. You need to enter a user-defined password that does not contain number signs (#).

  • Prev
  • Next
last updated: 2025-07-09 15:07 UTC - commit: cb943fa3145d5c3e150bb4fa1a987d24c3077fe9
Edit pageReport Documentation Bug
Page Contents
  • Common Flink Shell Commands
© T-Systems International GmbH
  • Contact
  • Data privacy
  • Disclaimer of Liabilities
  • Imprint