2、配置yarn,现场演示配置结果和回答相关问题,并写出详细配置流程说明及相应的截图。
配置yarn相关文件,目录/usr/hadoop/hadoop-3.1.4/etc/hadoop/
①配置文件hadoop-env.sh
export YARN_RESOURCEMANAGER_USER=root
export YARN_NODEMANAGER_USER=root
② mapred-site.xml
<!-- 配置yarn框架作为mapreduce的资源调度器 -->
<property>
<name>mapreduce.framework.name</name>
<value>yarn</value>
</property>
<property>
<name>mapreduce.application.classpath</name>
<value>
/usr/hadoop/hadoop-3.1.4/etc/hadoop,
/usr/hadoop/hadoop-3.1.4/share/hadoop/common/*,
/usr/hadoop/hadoop-3.1.4/share/hadoop/common/lib/*,
/usr/hadoop/hadoop-3.1.4/share/hadoop/hdfs/*,
/usr/hadoop/hadoop-3.1.4/share/hadoop/hdfs/lib/*,
/usr/hadoop/hadoop-3.1.4/share/hadoop/mapreduce/*,
/usr/hadoop/hadoop-3.1.4/share/hadoop/mapreduce/lib/*,
/usr/hadoop/hadoop-3.1.4/share/hadoop/yarn/*,
/usr/hadoop/hadoop-3.1.4/share/hadoop/yarn/lib/*
</value>
</property>
③yarn-site.xml
<!-- mapreduce计算服务方法 -->
<property>
<name>yarn.nodemanager.aux-services</name>
<value>mapreduce_shuffle</value>
</property>
<!-- 配置resourcemanager的主机ip -->
<property>
<name>yarn.resourcemanager.hostname</name>
<value>master122</value>
</property>
<property>
<name>yarn.application.classpath</name>
<value>
/usr/hadoop/hadoop-3.1.4/etc/hadoop/,
/usr/hadoop/hadoop-3.1.4/share/hadoop/common/*,
/usr/hadoop/hadoop-3.1.4/share/hadoop/common/lib/*,
/usr/hadoop/hadoop-3.1.4/share/hadoop/hdfs/*,
/usr/hadoop/hadoop-3.1.4/share/hadoop/hdfs/lib/*,
/usr/hadoop/hadoop-3.1.4/share/hadoop/mapreduce/*,
/usr/hadoop/hadoop-3.1.4/share/hadoop/mapreduce/lib/*,
/usr/hadoop/hadoop-3.1.4/share/hadoop/yarn/*,
/usr/hadoop/hadoop-3.1.4/share/hadoop/yarn/lib/*
</value>
</property>
<property>
<name>yarn.nodemanager.vmem-check-enabled</name>
<value>false</value>
</property>
<property>
<name>yarn.nodemanager.pmem-check-enabled</name>
<value>false</value>
</property>
④ workers配置文件
master122
⑤启动yarn:start-yarn.sh //已启动hdfs
查看jps进程
访问yarn的资源调度器web网页:http://master122:8088