简体   繁体   中英

How to get get Application Id in submitting Flink jobs into Yarn use command line interface?

my team is building a flink based realtime computation platform. We submit flink job to Yarn. We create a Process and run commit command use CLI. In order to get yarn application id, we create a thread and parse process output. Application id is used in other methods.

For example, we submit job by this command:

nohup flink run  -m yarn-cluster -d -yqu root.default 
-ynm BDP_RTC_FLINK_10457_MultiOutputTestFrontEnd -yjm 1024 
-yn 2 -ytm 1024 -ys 2 

The output is shown below:

2018-10-10 11:21:04 [info] 2018-10-10 11:21:04,629 INFO  org.apache.flink.yarn.AbstractYarnClusterDescriptor           - Submitting application master application_1536669298614_67675
2018-10-10 11:21:04 [info] 2018-10-10 11:21:04,654 INFO  org.apache.hadoop.yarn.client.api.impl.YarnClientImpl         - Submitted application application_1536669298614_67675
2018-10-10 11:21:04 [info] 2018-10-10 11:21:04,656 INFO  org.apache.flink.yarn.AbstractYarnClusterDescriptor           - Deploying cluster, current state ACCEPTED
2018-10-10 11:21:12 [info] 2018-10-10 11:21:12,699 INFO  org.apache.flink.yarn.AbstractYarnClusterDescriptor           - YARN application has been deployed successfully.
2018-10-10 11:21:12 [info] 2018-10-10 11:21:12,700 INFO  org.apache.flink.yarn.AbstractYarnClusterDescriptor           - The Flink YARN client has been started in detached mode.

We parse process output and get application id: application_1536669298614_67675 .

Are there any other elegant solutions to get application id in our situation?

Maybe you can get the relation between the yarn application and the flink job.

Firstly, list the yarn application.

yarn application -list

Then, you get the application list, and you can list flink job on the yarn application.

./bin/flink list -m yarn-cluster -yid <Yarn Application Id>

By the way, you can use

./bin/flink run -d

not use

nohup

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM