[Big data] Hadoop-Yarn commonly used operation and maintenance commands

view tasks

List all Applications

yarn application -list

Filter by Application Status

yarn application -list -appStates

Kill the Application

yarn application -kill <ApplicationId>

View cluster load and resource status

Use the yarn top command to view, similar to linux top

yarn top
NodeManager(s): 3 total, 3 active, 0 unhealthy, 0 decommissioned, 0 lost, 0 rebooted
Queue(s) Applications: 1 running, 33 submitted, 0 pending, 31 completed, 0 killed, 1 failed
Queue(s) Mem(GB): 17 available, 6 allocated, 0 pending, 0 reserved
Queue(s) VCores: 21 available, 2 allocated, 0 pending, 0 reserved
Queue(s) Containers: 2 allocated, 0 pending, 0 reserved


 application_1676450522732_0035 root            spark    default     0       2       0       2       0      6G      0G         76        232  10.00   00:00:00 org.ap

yarn logs view logs

Query Application logs

yarn logs -applicationId <ApplicationId>

view am log

bin/yarn logs -am [1,2] -applicationId <ApplicationId>

yarn applicationattempt to view the tasks that are trying to run

yarn applicationattempt -list <ApplicationId>

Print ApplicationAttemp status

yarn applicationattempt -status <ApplicationAttemptId>

yarn container view container

List all Containers

yarn container -list <ApplicationAttemptId>

Print Container Status

The status of the container can only be seen when the task is running

yarn container -status <ContainerId>

yarn node view node status

list all nodes

yarn node -list -all

yarn rmadmin update configuration

load queue configuration

yarn rmadmin -refreshQueues

yarn queue view queue

print queue information

yarn queue -status <QueueName>

I hope it will be helpful to you who are viewing the article, remember to pay attention, comment, and favorite, thank you

Guess you like

Origin blog.csdn.net/u013412066/article/details/129472118