我的团队正在构建一个基于flink的实时计算平台。我们提交flink工作给Yarn。我们创建一个进程并使用CLI运行提交命令。为了获得yarn应用程序id,我们创建了一个线程并解析进程输出。应用程序id在其他方法中使用。
例如,我们通过以下命令提交作业:
nohup flink run -m yarn-cluster -d -yqu root.default
-ynm BDP_RTC_FLINK_10457_MultiOutputTestFrontEnd -yjm 1024
-yn 2 -ytm 1024 -ys 2 输出如下所示:
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.我们解析流程输出并获得应用程序id:application_1536669298614_67675。
在我们的情况下,有没有其他很好的解决方案来获取应用程序id?
发布于 2019-01-22 14:27:28
也许你可以得到纱线应用程序和flink任务之间的关系。
首先,列出纱线的应用。
yarn application -list然后,您将获得应用程序列表,并且可以在纱线应用程序上列出flink作业。
./bin/flink list -m yarn-cluster -yid <Yarn Application Id>顺便说一下,您可以使用
./bin/flink run -d不使用
nohuphttps://stackoverflow.com/questions/52734070
复制相似问题