hadoop2集群非ha模式下搭建配置文件写法

1 关于防火墙配置,ssh这里没有在讲述, 这里仅仅是讲述hadoop配置文件写法,启动命令等也没有描述

2 写法如下:

hadoop 简答分布式安装:  非ha版:


a) 修改配置文件etc/hadoop/hadoop-env.sh
export JAVA_HOME=/usr/local/jdk1.7 

b) 修改配置文件etc/hadoop/core-site.xml: 

<configuration>
	<property>  
        <name>fs.defaultFS</name>  
        <value>hdfs://hadoop1:9000</value>  
    </property> 
	<property>  
        <name>hadoop.tmp.dir</name>  
        <value>/home/forkylin/hadoop-2.2.0/tmp</value>      
    </property>  
    <property>  
        <name>fs.trash.interval</name>  
        <value>1440</value>  
    </property> 
</configuration>


c) 修改配置文件etc/hadoop/hdfs-site.xml: 

<configuration>  

	<property>  
        <name>dfs.namenode.secondary.http-address</name>  
        <value>hadoop1:9001</value>  
    </property>
	<property>  
        <name>dfs.webhdfs.enabled</name>  
        <value>true</value>  
    </property>
    <property>  
        <name>dfs.replication</name>  
        <value>2</value>  
    </property>  
</configuration>  


e)拷贝模板文件并重命名:  
[root@h2single511-115 hadoop]# cp  mapred-site.xml.template   mapred-site.xml 

f) 修改配置文件etc/hadoop/mapred-site.xml: 
<configuration>  
    <property>  
        <name>mapreduce.framework.name</name>  
        <value>yarn</value>  
    </property>
    <property>  
        <name>mapreduce.jobhistory.address</name>  
        <value>hadoop1:10020</value>  
    </property>	

<property>  
        <name>mapreduce.map.memory.mb</name>  
        <value>5120</value>  
    </property>	
<property>  
        <name>mapreduce.reduce.memory.mb</name>  
        <value>5120</value>  
    </property>	

<property>  
        <name>yarn.app.mapreduce.am.resource.mb</name>  
        <value>2560</value>  
    </property>	




</configuration>  





g)修改配置文件etc/hadoop/yarn-site.xml: 

<configuration>  
    <property>  
        <name>yarn.nodemanager.aux-services</name>  
        <value>mapreduce_shuffle</value>  
    </property>  
	 <property>  
        <name>yarn.resourcemanager.address</name>  
        <value>hadoop1:8032</value>  
    </property>
	 <property>  
        <name>yarn.resourcemanager.resource-tracker.address</name>  
        <value>hadoop1:8031</value>  
    </property>
	<property>  
        <name>yarn.resourcemanager.admin.address</name>  
        <value>hadoop1:8033</value>  
    </property>
	<property>  
        <name>yarn.resourcemanager.webapp.address</name>  
        <value>hadoop1:8088</value>  
    </property>
<property>  
        <name>yarn.schedular.minimum.allocation-mb</name>  
        <value>1024</value>  
    </property>

<property>  
        <name>yarn.schedular.maximum.allocation-mb</name>  
        <value>10240</value>  
    </property>



</configuration>   


h)修改配置文件etc/hadoop/slaves: 
hadoop4
hadoop5


然后将修好好的hadoop解压文件拷贝到hadoop4  hadoop5机器中,

相关推荐