配置文件如下:
hadoop 联邦配置:
1.配置hadoop-env.sh
vim hadoop-2.7.2/etc/hadoop/hadoop-env.sh
export JAVA_HOME=/usr/jdk1.7.0_25
2.配置mapreduce:
[qujian@master ~]$ cp hadoop-2.7.2/etc/hadoop/mapred-site.xml.template hadoop-2.7.2/etc/hadoop/mapred-site.xml
[qujian@master ~]$ vim hadoop-2.7.2/etc/hadoop/mapred-site.xml
<property>
<name>mapreduce.framework.name</name>
<value>yarn</value>
</property>
3.修改yarn-site.xml
vim hadoop-2.7.2/etc/hadoop/yarn-site.xml
<property>
<name>yarn.nodemanager.aux-services</name>
<value>mapreduce_shuffle</value>
</property>
<property>
<name>yarn.nodemanager.aux-services.mapreduce_shuffle.class</name>
<value>org.apache.hadoop.mapred.ShuffleHandler</value>
</property>
<property>
<name>yarn.resourcemanager.address</name>
<value>master.hadoop.cn:8032</value>
</property>
<property>
<name>yarn.resourcemanager.scheduler.address</name>
<value>master.hadoop.cn:8030</value>
</property>
<property>
<name>yarn.resourcemanager.resource-tracker.address</name>
<value>master.hadoop.cn:8031</value>
</property>
<property>
<name>yarn.resourcemanager.admin.address</name>
<value>master.hadoop.cn:8033</value>
</property>
<property>
<name>yarn.resourcemanager.webapp.address</name>
<value>master.hadoop.cn:8088</value>
</property>
4.修改slave
[qujian@master ~]$ vim hadoop-2.7.2/etc/hadoop/slaves
second2.hadoop.cn
data1.hadoop.cn
data2.hadoop.cn
5.配置core-site.xml
[qujian@master ~]$ vim hadoop-2.7.2/etc/hadoop/core-site.xml
<property>
<name>fs.defaultFS</name>
<value>hdfs://master.hadoop.cn:9000</value>
</property>
<property>
<name>io.file.buffer.size</name>
<value>4096</value>
</property>
<property>
<name>hadoop.tmp.dir</name>
<value>file:/home/qujian/hadoop-2.7.2/tmp</value>
</property>
6.修改hdfs-site.xml
[qujian@master ~]$ vim hadoop-2.7.2/etc/hadoop/hdfs-site.xml
<property>
<name>dfs.namenode.name.dir</name>
<value>file:/home/qujian/hadoop-2.7.2/name</value>
</property>
<property>
<name>dfs.datanode.data.dir</name>
<value>file:/home/qujian/hadoop-2.7.2/data</value>
</property>
<property>
<name>dfs.replication</name>
<value>3</value>
</property>
<property>
<name>dfs.webhdfs.enabled</name>
<value>true</value>
</property>
<property>
<name>dfs.permissions.enabled</name>
<value>false</value>
</property>
<property>
<name>dfs.nameservices</name>
<value>ns1,ns2</value>
</property>
<property>
<name>dfs.namenode.rpc-address.ns1</name>
<value>master.hadoop.cn:9000</value>
</property>
<property>
<name>dfs.namenode.http-address.ns1</name>
<value>master.hadoop.cn:50070</value>
</property>
<property>
<name>dfs.namenode.rpc-address.ns2</name>
<value>second1.hadoop.cn:9000</value>
</property>
<property>
<name>dfs.namenode.http-address.ns2</name>
<value>second1.hadoop.cn:50070</value>
</property>
本文转自 zhuxtqw 51CTO博客,原文链接:http://blog.51cto.com/1054054/1748113,如需转载请自行联系原作者