以此记录自己使用Mac学习hadoop的心酸过程。网上有很多零零散散的教程,遇到的问题各不相同,希望我也能为大家提供一点帮助。
一、Yarn概述
Yarn是一个资源调度平台,负责为运算程序提供服务器运算资源,相当于一个分布式的操作系统平台,主要由ResourceManager、NodeManager、ApplicationMaster和Container等组件构成。
二、Hadoop调度器
FIFO、容量、公平。
三、常用命令
(1)列出所有Application:
yarn application -list
(2)根据Application状态过滤:
yarn application -list -appStates +状态:ALL、NEW、NEW_SAVING、SUBMITTED、ACCEPTED、RUNNING、FINISHED、FAILED、KILLED
yarn application -list -appStates FINISHED
(3)Kill掉Application:
yarn application -kill ApplicationID
(4)查询Application日志:
yarn logs -applicationId <ApplicationId>
(5)查询Container日志:
yarn logs -applicationId <ApplicationId> -containerId <ContainerId>
(6)列出所有Application尝试的列表:
yarn applicationattempt -list <ApplicationId>
(7)打印ApplicationAttemp状态:
yarn applicationattempt -status <ApplicationAttemptId>
(8)列出所有Container:
yarn container -list <ApplicationAttemptId>
(9)打印Container状态:
yarn container -status <ContainerId>
注:只有在任务跑的途中才能看到container的状态
(10)列出所有节点:
yarn node -list -all
(11)yarn rmadmin更新配置:
yarn rmadmin -refreshQueues
(12)yarn queue查看队列:
yarn queue -status <QueueName>
四、Yarn总结
听完yarn的相关基础知识课程,我片面的理解是:Yarn需要根据生产环境进行合理的配置,包括hdfs、mapreduce等核心参数的配置、调度器的选择、资源的分配、多任务运行等。就我现在的工作环境而言,我就粗略过了一下,大致了解了一下。