yarn配置、启动、测试

 

1: yarn共用hdfs的core-site.xml和hdfs-site.xml 。
2 : yarn-site.xml 配置:

 <property>
        <name>yarn.resourcemanager.webapp.address</name>
        <value>bigdata0:8088</value>
    </property>
    <property>
        <name>yarn.resourcemanager.hostname</name>
        <value>bigdata0</value>
    </property>
    <property>
        <name>yarn.nodemanager.log-dirs</name>
        <value>/mnt/home/1141797198/yarn/0/logs,/mnt/home/1141797198/yarn/1/logs,/mnt/home/1141797198/home/yarn/2/logs</value>
    </property>
    <property>
        <name>yarn.nodemanager.local-dirs</name>
        <value>/mnt/home/1141797198/yarn/0/local,/mnt/home/1141797198/yarn/1/local,/mnt/home/1141797198/yarn/2/local</value>
    </property>
    <property>
        <name>yarn.nodemanager.aux-services</name>
        <value>mapreduce_shuffle</value>
    </property>
  • 1

3:mapred-site.xml配置:

<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
<configuration>
    <property>
        <name>mapreduce.framework.name</name>
        <value>yarn</value>
    </property>
    <property>
        <name>mapreduce.jobhistory.address</name>
        <value>bigdata0:10020</value>
    </property>
    <property>
        <name>mapreduce.jobhistory.webapp.address</name>
        <value>bigdata0:19888</value>
    </property>
</configuration>
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16

4:启动:yarn resourcemanager
5 : 创建目录:

        mkdir -p /mnt/home/1141797198/yarn/{0..2}/logs
        mkdir -p /mnt/home/1131797197/yarn/{0..2}/local
  • 1
  • 2

6 : 启动nodemanager

    /mnt/home/1141797198/hadoop-current/bin/yarn nodemanager
  • 1

7 : 测试 :hadoop jar hadoop-current/share/hadoop/mapreduce/hadoop -mapreduce-examples-2.7.6.jar pi 5 10
8 :测试 hadoop jar share/hadoop/mapreduce/hadoop -mapreduce-examples-2.7.6.jar wordcount /user/hadoop/input /user/hadoop/output
9:启动mapred historyserver:

mapred historyserver
  • 1

10 : 后台启动:

    /mnt/home/1141797198/hadoop-current/sbin/yarn-deamon.sh start resourcemanager
    /mnt/home/1141797198/hadoop-current/sbin/yarn-deamon.sh start nodemanager
    /mnt/home/1141797198/hadoop-current/sbin/mr-jobhistory-deamon.sh start historyserver
posted @ 2020-10-19 14:05  威武的大萝卜  阅读(723)  评论(0编辑  收藏  举报