简体   繁体   English

在使用命令行界面将Flink作业提交到Yarn中时,如何获取应用程序ID?

[英]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. 我的团队正在构建一个基于flink的实时计算平台。 We submit flink job to Yarn. 我们将flink作业提交给Yarn。 We create a Process and run commit command use CLI. 我们创建一个流程并使用CLI运行commit命令。 In order to get yarn application id, we create a thread and parse process output. 为了获得纱线应用程序ID,我们创建一个线程并解析过程输出。 Application id is used in other methods. 应用程序ID用于其他方法。

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 . 我们解析进程输出并获取应用程序ID: application_1536669298614_67675

Are there any other elegant solutions to get application id in our situation? 在我们的情况下,是否还有其他优雅的解决方案来获取应用程序ID?

Maybe you can get the relation between the yarn application and the flink job. 也许您可以得到纱线应用程序和flink作业之间的关系。

Firstly, list the yarn application. 首先,列出纱线应用。

yarn application -list

Then, you get the application list, and you can list flink job on the yarn application. 然后,您将获得应用程序列表,并且可以在yarn应用程序上列出flink作业。

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

By the way, you can use 顺便说一句,你可以使用

./bin/flink run -d

not use 不使用

nohup

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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