yarn配置启动

1.配置 mapred-site.xml(集群所有文件)
进入目录 /usr/local/hadoop/etc/hadoop/

vim /usr/local/hadoop/etc/hadoop/mapred-site.xml
写入

    mapreduce.framework.name
    yarn

2.配置yarn-site.xml(集群所有文件)
进入目录 /usr/local/hadoop/etc/hadoop/

vim /usr/local/hadoop/etc/hadoop/yarn-site.xml
写入

    yarn.nodemanager.aux-services
    mapreduce_shuffle


 yarn.nodemanager.auxservices.mapreduce.shuffle.class    org.apache.hadoop.mapred.ShuffleHandler


     yarn.nodemanager.aux-services
     mapreduce_shuffle


   yarn.resourcemanager.ha.enabled
   true


   yarn.resourcemanager.cluster-id
   cluster1


   yarn.resourcemanager.ha.rm-ids
   rm1,rm2


   yarn.resourcemanager.hostname.rm1
   slave2


   yarn.resourcemanager.hostname.rm2
   slave3


   yarn.resourcemanager.zk-address
   slave1:2181,slave2:2181,slave3:2181
 

3.yarn启动
master上执行 start-all.sh
此时nodemanager和resourcemanager不会启动,需要在master上:

yarn-daemon.sh start nodemanager     

在slaveX上:

yarn-daemon.sh start resourcemanager     

运行JPS发现master上有nodemanager,slaveX上有resourcemanager。则yarn启动完成。

你可能感兴趣的:(yarn配置启动)