Flink官网学习:https://nightlies.apache.org/flink/flink-docs-release-1.15/docs/learn-flink/datastream_api/

    1. [root@node1 bin]# /export/server/flink/bin/flink --help
    2. ./flink <ACTION> [OPTIONS] [ARGUMENTS]
    3. The following actions are available:
    4. Action "run" compiles and runs a program.
    5. Syntax: run [OPTIONS] <jar-file> <arguments>
    6. "run" action options:
    7. -c,--class <classname> Class with the program entry point
    8. ("main()" method). Only needed if the
    9. JAR file does not specify the class in
    10. its manifest.
    11. -C,--classpath <url> Adds a URL to each user code
    12. classloader on all nodes in the
    13. cluster. The paths must specify a
    14. protocol (e.g. file://) and be
    15. accessible on all nodes (e.g. by means
    16. of a NFS share). You can use this
    17. option multiple times for specifying
    18. more than one URL. The protocol must
    19. be supported by the {@link
    20. java.net.URLClassLoader}.
    21. -d,--detached If present, runs the job in detached
    22. mode
    23. -n,--allowNonRestoredState Allow to skip savepoint state that
    24. cannot be restored. You need to allow
    25. this if you removed an operator from
    26. your program that was part of the
    27. program when the savepoint was
    28. triggered.
    29. -p,--parallelism <parallelism> The parallelism with which to run the
    30. program. Optional flag to override the
    31. default value specified in the
    32. configuration.
    33. -py,--python <pythonFile> Python script with the program entry
    34. point. The dependent resources can be
    35. configured with the `--pyFiles`
    36. option.
    37. -pyarch,--pyArchives <arg> Add python archive files for job. The
    38. archive files will be extracted to the
    39. working directory of python UDF
    40. worker. Currently only zip-format is
    41. supported. For each archive file, a
    42. target directory be specified. If the
    43. target directory name is specified,
    44. the archive file will be extracted to
    45. a name can directory with the
    46. specified name. Otherwise, the archive
    47. file will be extracted to a directory
    48. with the same name of the archive
    49. file. The files uploaded via this
    50. option are accessible via relative
    51. path. '#' could be used as the
    52. separator of the archive file path and
    53. the target directory name. Comma (',')
    54. could be used as the separator to
    55. specify multiple archive files. This
    56. option can be used to upload the
    57. virtual environment, the data files
    58. used in Python UDF (e.g.: --pyArchives
    59. file:///tmp/py37.zip,file:///tmp/data.
    60. zip#data --pyExecutable
    61. py37.zip/py37/bin/python). The data
    62. files could be accessed in Python UDF,
    63. e.g.: f = open('data/data.txt', 'r').
    64. -pyexec,--pyExecutable <arg> Specify the path of the python
    65. interpreter used to execute the python
    66. UDF worker (e.g.: --pyExecutable
    67. /usr/local/bin/python3). The python
    68. UDF worker depends on Python 3.5+,
    69. Apache Beam (version == 2.23.0), Pip
    70. (version >= 7.1.0) and SetupTools
    71. (version >= 37.0.0). Please ensure
    72. that the specified environment meets
    73. the above requirements.
    74. -pyfs,--pyFiles <pythonFiles> Attach custom python files for job.
    75. These files will be added to the
    76. PYTHONPATH of both the local client
    77. and the remote python UDF worker. The
    78. standard python resource file suffixes
    79. such as .py/.egg/.zip or directory are
    80. all supported. Comma (',') could be
    81. used as the separator to specify
    82. multiple files (e.g.: --pyFiles
    83. file:///tmp/myresource.zip,hdfs:///$na
    84. menode_address/myresource2.zip).
    85. -pym,--pyModule <pythonModule> Python module with the program entry
    86. point. This option must be used in
    87. conjunction with `--pyFiles`.
    88. -pyreq,--pyRequirements <arg> Specify a requirements.txt file which
    89. defines the third-party dependencies.
    90. These dependencies will be installed
    91. and added to the PYTHONPATH of the
    92. python UDF worker. A directory which
    93. contains the installation packages of
    94. these dependencies could be specified
    95. optionally. Use '#' as the separator
    96. if the optional parameter exists
    97. (e.g.: --pyRequirements
    98. file:///tmp/requirements.txt#file:///t
    99. mp/cached_dir).
    100. -s,--fromSavepoint <savepointPath> Path to a savepoint to restore the job
    101. from (for example
    102. hdfs:///flink/savepoint-1537).
    103. -sae,--shutdownOnAttachedExit If the job is submitted in attached
    104. mode, perform a best-effort cluster
    105. shutdown when the CLI is terminated
    106. abruptly, e.g., in response to a user
    107. interrupt, such as typing Ctrl + C.
    108. Options for Generic CLI mode:
    109. -D <property=value> Allows specifying multiple generic configuration
    110. options. The available options can be found at
    111. https://ci.apache.org/projects/flink/flink-docs-stabl
    112. e/ops/config.html
    113. -e,--executor <arg> DEPRECATED: Please use the -t option instead which is
    114. also available with the "Application Mode".
    115. The name of the executor to be used for executing the
    116. given job, which is equivalent to the
    117. "execution.target" config option. The currently
    118. available executors are: "remote", "local",
    119. "kubernetes-session", "yarn-per-job", "yarn-session".
    120. -t,--target <arg> The deployment target for the given application,
    121. which is equivalent to the "execution.target" config
    122. option. For the "run" action the currently available
    123. targets are: "remote", "local", "kubernetes-session",
    124. "yarn-per-job", "yarn-session". For the
    125. "run-application" action the currently available
    126. targets are: "kubernetes-application",
    127. "yarn-application".
    128. Options for yarn-cluster mode:
    129. -d,--detached If present, runs the job in detached
    130. mode
    131. -m,--jobmanager <arg> Set to yarn-cluster to use YARN
    132. execution mode.
    133. -yat,--yarnapplicationType <arg> Set a custom application type for the
    134. application on YARN
    135. -yD <property=value> use value for given property
    136. -yd,--yarndetached If present, runs the job in detached
    137. mode (deprecated; use non-YARN
    138. specific option instead)
    139. -yh,--yarnhelp Help for the Yarn session CLI.
    140. -yid,--yarnapplicationId <arg> Attach to running YARN session
    141. -yj,--yarnjar <arg> Path to Flink jar file
    142. -yjm,--yarnjobManagerMemory <arg> Memory for JobManager Container with
    143. optional unit (default: MB)
    144. -ynl,--yarnnodeLabel <arg> Specify YARN node label for the YARN
    145. application
    146. -ynm,--yarnname <arg> Set a custom name for the application
    147. on YARN
    148. -yq,--yarnquery Display available YARN resources
    149. (memory, cores)
    150. -yqu,--yarnqueue <arg> Specify YARN queue.
    151. -ys,--yarnslots <arg> Number of slots per TaskManager
    152. -yt,--yarnship <arg> Ship files in the specified directory
    153. (t for transfer)
    154. -ytm,--yarntaskManagerMemory <arg> Memory per TaskManager Container with
    155. optional unit (default: MB)
    156. -yz,--yarnzookeeperNamespace <arg> Namespace to create the Zookeeper
    157. sub-paths for high availability mode
    158. -z,--zookeeperNamespace <arg> Namespace to create the Zookeeper
    159. sub-paths for high availability mode
    160. Options for default mode:
    161. -D <property=value> Allows specifying multiple generic
    162. configuration options. The available
    163. options can be found at
    164. https://ci.apache.org/projects/flink/flink-
    165. docs-stable/ops/config.html
    166. -m,--jobmanager <arg> Address of the JobManager to which to
    167. connect. Use this flag to connect to a
    168. different JobManager than the one specified
    169. in the configuration. Attention: This
    170. option is respected only if the
    171. high-availability configuration is NONE.
    172. -z,--zookeeperNamespace <arg> Namespace to create the Zookeeper sub-paths
    173. for high availability mode
    174. Action "run-application" runs an application in Application Mode.
    175. Syntax: run-application [OPTIONS] <jar-file> <arguments>
    176. Options for Generic CLI mode:
    177. -D <property=value> Allows specifying multiple generic configuration
    178. options. The available options can be found at
    179. https://ci.apache.org/projects/flink/flink-docs-stabl
    180. e/ops/config.html
    181. -e,--executor <arg> DEPRECATED: Please use the -t option instead which is
    182. also available with the "Application Mode".
    183. The name of the executor to be used for executing the
    184. given job, which is equivalent to the
    185. "execution.target" config option. The currently
    186. available executors are: "remote", "local",
    187. "kubernetes-session", "yarn-per-job", "yarn-session".
    188. -t,--target <arg> The deployment target for the given application,
    189. which is equivalent to the "execution.target" config
    190. option. For the "run" action the currently available
    191. targets are: "remote", "local", "kubernetes-session",
    192. "yarn-per-job", "yarn-session". For the
    193. "run-application" action the currently available
    194. targets are: "kubernetes-application",
    195. "yarn-application".
    196. Action "info" shows the optimized execution plan of the program (JSON).
    197. Syntax: info [OPTIONS] <jar-file> <arguments>
    198. "info" action options:
    199. -c,--class <classname> Class with the program entry point
    200. ("main()" method). Only needed if the JAR
    201. file does not specify the class in its
    202. manifest.
    203. -p,--parallelism <parallelism> The parallelism with which to run the
    204. program. Optional flag to override the
    205. default value specified in the
    206. configuration.
    207. Action "list" lists running and scheduled programs.
    208. Syntax: list [OPTIONS]
    209. "list" action options:
    210. -a,--all Show all programs and their JobIDs
    211. -r,--running Show only running programs and their JobIDs
    212. -s,--scheduled Show only scheduled programs and their JobIDs
    213. Options for Generic CLI mode:
    214. -D <property=value> Allows specifying multiple generic configuration
    215. options. The available options can be found at
    216. https://ci.apache.org/projects/flink/flink-docs-stabl
    217. e/ops/config.html
    218. -e,--executor <arg> DEPRECATED: Please use the -t option instead which is
    219. also available with the "Application Mode".
    220. The name of the executor to be used for executing the
    221. given job, which is equivalent to the
    222. "execution.target" config option. The currently
    223. available executors are: "remote", "local",
    224. "kubernetes-session", "yarn-per-job", "yarn-session".
    225. -t,--target <arg> The deployment target for the given application,
    226. which is equivalent to the "execution.target" config
    227. option. For the "run" action the currently available
    228. targets are: "remote", "local", "kubernetes-session",
    229. "yarn-per-job", "yarn-session". For the
    230. "run-application" action the currently available
    231. targets are: "kubernetes-application",
    232. "yarn-application".
    233. Options for yarn-cluster mode:
    234. -m,--jobmanager <arg> Set to yarn-cluster to use YARN execution
    235. mode.
    236. -yid,--yarnapplicationId <arg> Attach to running YARN session
    237. -z,--zookeeperNamespace <arg> Namespace to create the Zookeeper
    238. sub-paths for high availability mode
    239. Options for default mode:
    240. -D <property=value> Allows specifying multiple generic
    241. configuration options. The available
    242. options can be found at
    243. https://ci.apache.org/projects/flink/flink-
    244. docs-stable/ops/config.html
    245. -m,--jobmanager <arg> Address of the JobManager to which to
    246. connect. Use this flag to connect to a
    247. different JobManager than the one specified
    248. in the configuration. Attention: This
    249. option is respected only if the
    250. high-availability configuration is NONE.
    251. -z,--zookeeperNamespace <arg> Namespace to create the Zookeeper sub-paths
    252. for high availability mode
    253. Action "stop" stops a running program with a savepoint (streaming jobs only).
    254. Syntax: stop [OPTIONS] <Job ID>
    255. "stop" action options:
    256. -d,--drain Send MAX_WATERMARK before taking the
    257. savepoint and stopping the pipelne.
    258. -p,--savepointPath <savepointPath> Path to the savepoint (for example
    259. hdfs:///flink/savepoint-1537). If no
    260. directory is specified, the configured
    261. default will be used
    262. ("state.savepoints.dir").
    263. Options for Generic CLI mode:
    264. -D <property=value> Allows specifying multiple generic configuration
    265. options. The available options can be found at
    266. https://ci.apache.org/projects/flink/flink-docs-stabl
    267. e/ops/config.html
    268. -e,--executor <arg> DEPRECATED: Please use the -t option instead which is
    269. also available with the "Application Mode".
    270. The name of the executor to be used for executing the
    271. given job, which is equivalent to the
    272. "execution.target" config option. The currently
    273. available executors are: "remote", "local",
    274. "kubernetes-session", "yarn-per-job", "yarn-session".
    275. -t,--target <arg> The deployment target for the given application,
    276. which is equivalent to the "execution.target" config
    277. option. For the "run" action the currently available
    278. targets are: "remote", "local", "kubernetes-session",
    279. "yarn-per-job", "yarn-session". For the
    280. "run-application" action the currently available
    281. targets are: "kubernetes-application",
    282. "yarn-application".
    283. Options for yarn-cluster mode:
    284. -m,--jobmanager <arg> Set to yarn-cluster to use YARN execution
    285. mode.
    286. -yid,--yarnapplicationId <arg> Attach to running YARN session
    287. -z,--zookeeperNamespace <arg> Namespace to create the Zookeeper
    288. sub-paths for high availability mode
    289. Options for default mode:
    290. -D <property=value> Allows specifying multiple generic
    291. configuration options. The available
    292. options can be found at
    293. https://ci.apache.org/projects/flink/flink-
    294. docs-stable/ops/config.html
    295. -m,--jobmanager <arg> Address of the JobManager to which to
    296. connect. Use this flag to connect to a
    297. different JobManager than the one specified
    298. in the configuration. Attention: This
    299. option is respected only if the
    300. high-availability configuration is NONE.
    301. -z,--zookeeperNamespace <arg> Namespace to create the Zookeeper sub-paths
    302. for high availability mode
    303. Action "cancel" cancels a running program.
    304. Syntax: cancel [OPTIONS] <Job ID>
    305. "cancel" action options:
    306. -s,--withSavepoint <targetDirectory> **DEPRECATION WARNING**: Cancelling
    307. a job with savepoint is deprecated.
    308. Use "stop" instead.
    309. Trigger savepoint and cancel job.
    310. The target directory is optional. If
    311. no directory is specified, the
    312. configured default directory
    313. (state.savepoints.dir) is used.
    314. Options for Generic CLI mode:
    315. -D <property=value> Allows specifying multiple generic configuration
    316. options. The available options can be found at
    317. https://ci.apache.org/projects/flink/flink-docs-stabl
    318. e/ops/config.html
    319. -e,--executor <arg> DEPRECATED: Please use the -t option instead which is
    320. also available with the "Application Mode".
    321. The name of the executor to be used for executing the
    322. given job, which is equivalent to the
    323. "execution.target" config option. The currently
    324. available executors are: "remote", "local",
    325. "kubernetes-session", "yarn-per-job", "yarn-session".
    326. -t,--target <arg> The deployment target for the given application,
    327. which is equivalent to the "execution.target" config
    328. option. For the "run" action the currently available
    329. targets are: "remote", "local", "kubernetes-session",
    330. "yarn-per-job", "yarn-session". For the
    331. "run-application" action the currently available
    332. targets are: "kubernetes-application",
    333. "yarn-application".
    334. Options for yarn-cluster mode:
    335. -m,--jobmanager <arg> Set to yarn-cluster to use YARN execution
    336. mode.
    337. -yid,--yarnapplicationId <arg> Attach to running YARN session
    338. -z,--zookeeperNamespace <arg> Namespace to create the Zookeeper
    339. sub-paths for high availability mode
    340. Options for default mode:
    341. -D <property=value> Allows specifying multiple generic
    342. configuration options. The available
    343. options can be found at
    344. https://ci.apache.org/projects/flink/flink-
    345. docs-stable/ops/config.html
    346. -m,--jobmanager <arg> Address of the JobManager to which to
    347. connect. Use this flag to connect to a
    348. different JobManager than the one specified
    349. in the configuration. Attention: This
    350. option is respected only if the
    351. high-availability configuration is NONE.
    352. -z,--zookeeperNamespace <arg> Namespace to create the Zookeeper sub-paths
    353. for high availability mode
    354. Action "savepoint" triggers savepoints for a running job or disposes existing ones.
    355. Syntax: savepoint [OPTIONS] <Job ID> [<target directory>]
    356. "savepoint" action options:
    357. -d,--dispose <arg> Path of savepoint to dispose.
    358. -j,--jarfile <jarfile> Flink program JAR file.
    359. Options for Generic CLI mode:
    360. -D <property=value> Allows specifying multiple generic configuration
    361. options. The available options can be found at
    362. https://ci.apache.org/projects/flink/flink-docs-stabl
    363. e/ops/config.html
    364. -e,--executor <arg> DEPRECATED: Please use the -t option instead which is
    365. also available with the "Application Mode".
    366. The name of the executor to be used for executing the
    367. given job, which is equivalent to the
    368. "execution.target" config option. The currently
    369. available executors are: "remote", "local",
    370. "kubernetes-session", "yarn-per-job", "yarn-session".
    371. -t,--target <arg> The deployment target for the given application,
    372. which is equivalent to the "execution.target" config
    373. option. For the "run" action the currently available
    374. targets are: "remote", "local", "kubernetes-session",
    375. "yarn-per-job", "yarn-session". For the
    376. "run-application" action the currently available
    377. targets are: "kubernetes-application",
    378. "yarn-application".
    379. Options for yarn-cluster mode:
    380. -m,--jobmanager <arg> Set to yarn-cluster to use YARN execution
    381. mode.
    382. -yid,--yarnapplicationId <arg> Attach to running YARN session
    383. -z,--zookeeperNamespace <arg> Namespace to create the Zookeeper
    384. sub-paths for high availability mode
    385. Options for default mode:
    386. -D <property=value> Allows specifying multiple generic
    387. configuration options. The available
    388. options can be found at
    389. https://ci.apache.org/projects/flink/flink-
    390. docs-stable/ops/config.html
    391. -m,--jobmanager <arg> Address of the JobManager to which to
    392. connect. Use this flag to connect to a
    393. different JobManager than the one specified
    394. in the configuration. Attention: This
    395. option is respected only if the
    396. high-availability configuration is NONE.
    397. -z,--zookeeperNamespace <arg> Namespace to create the Zookeeper sub-paths
    398. for high availability mode