已SSH连接EMR主节点,如何获取YARN应用排查命令?
Hey there! Since you're already connected to your EMR master node via SSH, you don't need to hunt for external resources—all the YARN command documentation you need is right at your fingertips in the terminal. Here are the best ways to get started:
1. Use YARN's Built-in Help Command
The simplest way to see all available YARN commands is to run:
yarn help
This will output a full list of top-level commands (like application, logs, node, etc.) along with a brief description of what each does.
For deep dives into specific commands—especially those tied to application tracking—append --help to the command name. For example, to explore everything you can do with application IDs:
yarn application --help
This will show you all flags and options, like checking application status, listing running/completed apps, killing stuck applications, and more.
2. Quick Reference: Common Application-Tracking Commands
To save you time, here are some of the most useful commands for troubleshooting with an application ID:
- List all running and completed applications:
yarn application -list - Get detailed status of a specific application (replace
<your-app-id>with your actual ID):yarn application -status <your-app-id> - Fetch logs for a specific application:
yarn logs -applicationId <your-app-id> - Kill a stuck or unwanted application:
yarn application -kill <your-app-id>
3. Check Local Hadoop/YARN Documentation
EMR includes local copies of Hadoop's documentation. You can find the YARN command reference in the Hadoop installation directory (typically /usr/lib/hadoop-yarn on EMR). Look for the docs subfolder, or use man pages if they're installed:
man yarn
内容的提问来源于stack exchange,提问作者jagadish Prabhakar

