Flink common operation commands

Flink client operation commands

1. Submit tasks based on Yarn mode

Use the platform jar package to test:

./bin/flink run -m yarn-cluster -p 2 ./examples/batch/WordCount.jar      \
--input hdfs:///user/wupq/words.txt                        \
--output hdfs:///user/wupq/output2/2020122301

Submit your own code:

./bin/flink run -m yarn-cluster -yn 2 -c com.tencent.tbds.demo.KafkaSourceDemo /root/wupq/tbds-demo-1.0-SNAPSHOT.jar

Note: Flink1.12 version does not support the -yn parameter

2.flink run

-c, –class Entrance to Flink application
-C, –classpath Specifies a URL that can be accessed by all nodes, which can be used to load tool classes required by multiple applications
-d, –detached Whether to use detached mode is to submit a task , whether cli exits, if -d parameter is added, cli will exit
-n, –allowNonRestoredState allows skipping savepoints that cannot be restored. For example, delete part of the code operator
-p, --parallelism, execute parallelism
-s, --fromSavepoint, restore the task from savepoint
-sae, --shutdownOnAttachedExit, submit in attached mode, and shut down the cluster when the client exits

3.flink yarn-cluster mode

-d,–detached Whether to use detached mode
-m,–jobmanager Specify the submitted jobmanager
-yat,–yarnapplicationType Set the type of yarn application
-yD <property=value> Use the value of the given property
-yd,–yarndetached Use yarn detached mode
-yh,–yarnhelp yarn session help
-yid,–yarnapplicationId Hang on the running yarnsession
-yj,–yarnjar The path of the Flink jar file
-yjm,–yarnjobManagerMemory jobmanager’s memory (unit M)
-ynl,–yarnnodeLabel Specify YARN Application YARN node label
-ynm, –yarnname Customize the yarn application name
-yq, –yarnquery Display the available resources of yarn
–yqu, –yarnqueue Specify the yarn queue
–ys, –yarnslots Specify the number of slots for each taskmanager
–yt, –yarnship Transfer files in the specified directory
-ytm, –yarntaskManagerMemory Memory for each taskmanager
-yz, –yarnzookeeperNamespace The namespace used to create the zk subpath of ha
–z, –zookeeperNamespace The namespace used to create the zk subpath of ha

4. a lot of information

info [OPTIONS]

5.flink list (displays running or scheduled programs)

-a,–all displays all applications and corresponding job ids
-r,–running displays running applications and job ids
-s,–scheduled displays scheduled applications and job ids
#yarn-cluster mode
-m,–jobmanager specifies the connection The jobmanager
-yid,–yarnapplicationId hangs on the yarn session corresponding to the specified yarn id
-z,–zookeeperNamespace is used to create the namespace of the zk subpath of ha

6. flink stop (stop a running application)

-d,--drain Send MAX_WATERMARK before acquiring the savepoint and stopping the pipeline
-p,--savepointPath specifies the path of the savepoint. If not specified, the default value ("state.savepoints.dir") will be used.

7.savepoint (triggers a running application to generate a savepoint)

Syntax: savepoint [OPTIONS] []
-d,–dispose path to savepoint
-j,–jarfile Flink’s jar package

Guess you like

Origin blog.csdn.net/qq_42264264/article/details/113974691