hadoop2与hadoop1的配置有些许不同,最主要的是hadoop1里的master变成了yarn
这篇文直接从hadoop的配置开始,因为系统环境和jdk和hadoop1都是一样的。
hadoop1的配置链接,从第六步开始
六、设置hadoop2参数
进入 usr/local/hadoop/etc/hadoop 文件夹,即可看到以下文件
6.1配置hadoop-env.sh
找到export JAVA_HOME这一行,去除前面的#号注释符。
修改 export JAVA_HOME=/usr/local/jdk1.6.0_30
6.2配置core-site.xml
<configuration> <property> <name>fs.default.name</name> <value>hdfs://hadoop100:8020</value> <final>true</final> </property> <property> <name>hadoop.tmp.dir</name> <value>/home/hadoop/tmphadoop2.0</value> </property> </configuration>
6.3配置hdfs-site.xml
<configuration> <property> <name>dfs.namenode.name.dir</name> <value>/home/hadoop/tmphadoop2.0/dfs/name</value> <final>true</final> </property> <property> <name>dfs.datanode.data.dir</name> <value>/home/hadoop/tmphadoop2.0/dfs/data</value> <description>Determines where on the local filesystem an DFS data node should store its blocks. If this is a comma-delimited list of directories, then data will be stored in all named directories, typically on different devices. Directories that do not exist are ignored. </description> <final>true</final> </property> <property> <name>dfs.replication</name> <value>1</value> </property> <property> <name>dfs.permissions</name> <value>false</value> </property> </configuration>
6.4:配置mapred-site.xml
<configuration> <property> <name>mapreduce.framework.name</name> <value>yarn</value> </property> </configuration>
6.5配置yarn-site.xml
<?xml version="1.0"?> <configuration> <!-- Site specific YARN configuration properties --> <property> <name>yarn.resourcemanager.address</name> <value>hadoop100:8032</value> </property> <property> <name>yarn.resourcemanager.scheduler.address</name> <value>hadoop100:8030</value> </property> <property> <name>yarn.resourcemanager.resource-tracker.address</name> <value>hadoop100:8031</value> </property> <property> <name>yarn.resourcemanager.admin.address</name> <value>hadoop100:8033</value> </property> <property> <name>yarn.resourcemanager.webapp.address</name> <value>hadoop100:8088</value> </property> <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> </configuration>
6.6配置slaves
hadoop101 hadoop102
其他的和hadoop1都是一样的,这里就不在详述
时间: 2024-10-09 08:09:56