监控 Yarn 应用程序
在这一步中,我们将学习如何使用各种命令监控和管理 Yarn 应用程序。
列出正在运行的 Yarn 应用程序:
yarn application -list
终端中的示例输出:
UBMITTED, ACCEPTED, RUNNING, FINISHED, FAILED, KILLED] and tags: []):1
Application-Id Application-Name Application-Type User Queue State Final-State Progress Tracking-URL
application_1711070937750_0001 word count MAPREDUCE hadoop default FINISHED SUCCEEDED 100% http://iZj6cdxwclh8pms0k1vyyhZ:19888/jobhistory/job/job_1711070937750_0001
获取应用程序状态:
yarn application -status <application_id>
终端中的示例输出:
hadoop:~/ $ yarn application -status application_1711070937750_0001 [9:31:46]
2024-03-22 09:33:12,186 INFO client.DefaultNoHARMFailoverProxyProvider: Connecting to ResourceManager at /0.0.0.0:8032
2024-03-22 09:33:12,521 INFO conf.Configuration: resource-types.xml not found
2024-03-22 09:33:12,522 INFO resource.ResourceUtils: Unable to find 'resource-types.xml'.
Application Report :
Application-Id : application_1711070937750_0001
Application-Name : word count
Application-Type : MAPREDUCE
User : hadoop
Queue : default
Application Priority : 0
Start-Time : 1711071042168
Finish-Time : 1711071057334
终止正在运行的应用程序:
yarn application -kill <application_id>
终端中的示例输出:
hadoop:~/ $ yarn application -kill application_1711070937750_0001 [9:33:14]
2024-03-22 09:34:45,075 INFO client.DefaultNoHARMFailoverProxyProvider: Connecting to ResourceManager at /0.0.0.0:8032
Application application_1711070937750_0001 has already finished
提示:你可以通过 yarn application -list -appStates ALL
列出所有应用程序。
yarn application
命令允许你列出、监控和管理 Yarn 应用程序。你可以检索应用程序状态,甚至可以使用相应的子命令终止正在运行的应用程序。