yarn中的资源调度:
进程关系:
nodemanager要执行的脚本如下:
ll /tmp/hadoop-root/nm-local-dir/usercache/root/appcache/application_1576057255094_0007/container_1576057255094_0007_01_000003/
total 132
-rw-r--r-- 1 root root 129 Dec 12 04:15 container_tokens
-rwx------ 1 root root 723 Dec 12 04:15 default_container_executor.sh
-rwx------ 1 root root 669 Dec 12 04:15 default_container_executor_session.sh
lrwxrwxrwx 1 root root 105 Dec 12 04:15 job.jar -> /tmp/hadoop-root/nm-local-dir/usercache/root/appcache/application_1576057255094_0007/filecache/10/job.jar
-rw-r----- 1 root root 117057 Dec 12 04:15 job.xml
-rwx------ 1 root root 3571 Dec 12 04:15 launch_container.sh
lrwxrwxrwx 1 root root 64 Dec 12 04:15 sum.sh -> /tmp/hadoop-root/nm-local-dir/usercache/root/filecache/14/sum.sh
drwx--x--- 2 root root 6 Dec 12 04:15 tmp
1
2
3
4
5
6
7
8
9
10
ll/tmp/hadoop-root/nm-local-dir/usercache/root/appcache/application_1576057255094_0007/container_1576057255094_0007_01_000003/
total132
-rw-r--r--1rootroot129Dec1204:15container_tokens
-rwx------1rootroot723Dec1204:15default_container_executor.sh
-rwx------1rootroot669Dec1204:15default_container_executor_session.sh
lrwxrwxrwx1rootroot105Dec1204:15job.jar->/tmp/hadoop-root/nm-local-dir/usercache/root/appcache/application_1576057255094_0007/filecache/10/job.jar
-rw-r-----1rootroot117057Dec1204:15job.xml
-rwx------1rootroot3571Dec1204:15launch_container.sh
lrwxrwxrwx1rootroot64Dec1204:15sum.sh->/tmp/hadoop-root/nm-local-dir/usercache/root/filecache/14/sum.sh
drwx--x---2rootroot6Dec1204:15tmp
default_container_executor.sh ==调起===> default_container_executor_session.sh ===调起===> launch_container.sh ===> 调起 ===> org.apache.hadoop.mapred.YarnChild
这里的脚本都是临时生成的,从进程上来看,YarnChild 的父进程是 default_container_executor.sh 而不是 launch_container.sh,是因为从default_container_executor.sh 到 org.apache.hadoop.mapred.YarnChild 的中间的所有“调起”,都使用的是exec,并不fork新的进程,也没有新的进程ID,以至于 org.apache.hadoop.mapred.YarnChild 的父进程就是default_container_executor.sh
(MRAppMaster和YarnChild的诞生方式差不多,都是nodemanager直接生出来的),所以所,MRAppMaster是一个临时的进程
各进程关系
NameNode: 只有在name节点上存在,只有一个进程。
DataNode: 只存在于数据节点上,每个数据节点有且只有一个这样的常住进程,负责该节点上数据的存取维护操作。
NodeManger:
ResourceMange: