<configuration>
<property>
<name>mapreduce.framework.name</name>
<value>yarn</value>
</property>
</configuration>
yarn-site.xml
<configuration>
<!-- 指定nodemanager启动时加载server的方式为shuffle server -->
<property>
<name>yarn.nodemanager.aux-services</name>
<value>mapreduce_shuffle</value>
</property>
<!-- 指定resourcemanager地址 -->
<property>
<name>yarn.resourcemanager.hostname</name>
<value>mast3</value>
</property>
</configuration>
slaves
[hadoop@Mast1 hadoop]$ cat slaves
mast1
mast2
mast3
修改Java_HOME
分别在文件hadoop-env.sh和yarn-env.sh中添加JAVA_HOME配置
#export JAVA_HOME=${JAVA_HOME} --原来
export JAVA_HOME=/usr/local/java/jdk1.7.0_67
虽然默认配置了${JAVA_HOME}的环境变量,但是hadoop启动时,会提示找不到,没有办法,指定绝对路径,这个是必须的。
配置hadoop的环境变量,参考我的配置
[hadoop@Mast1 hadoop]$ vim ~/.bash_profile
export HADOOP_HOME="/home/hadoop/hadoop-2.5.2"
export PATH=$HADOOP_HOME/bin:$HADOOP_HOME/sbin:$PATH
export HADOOP_COMMON_LIB_NATIVE_DIR=$HADOOP_HOME/lib/native
export HADOOP_OPTS="-Djava.library.path=$HADOOP_HOME/lib"
将配置复制到mast2、mast3
scp -r ~/.bash_profile hadoop@mast2:/home/hadoop/
scp -r ~/.bash_profile hadoop@mast3:/home/hadoop/
scp -r $HADOOP_HOME/etc/hadoop hadoop@mast2:/home/hadoop/hadoop-2.5.2/etc/
scp -r $HADOOP_HOME/etc/hadoop hadoop@mast3:/home/hadoop/hadoop-2.5.2/etc/
至此Hadoop的配置完毕,接下来就是启动集群了