hadoop需要配置五個文件
第一個:
hadoop-env.sh
把裏面的下面一行改爲真正的java路徑
export JAVA_HOME=/usr/local/java/jdk1.7.0_79
第二個:
core-site.xml
<configuration>
<!-- 指定HDFS的namenode的通信地址 -->
<property>
<name>fs.default.name</name>
<value>hdfs://itcast:9000</value>
</property>
<!-- 指定hadoop運行時產生文件的存放目錄 -->
<property>
<name>hadoop.tmp.dir</name>
<value>/itcast/hadoop-2.7.3/tmp</value>
</property>
</configuration>
第三個:
hdfs-site.xml
<configuration>
<!-- 配置HDFS副本的數量 -->
<property>
<name>dfs.replication</name>
<value>1</value>
</property>
</configuration>
第四個:
mapred-site.xml
注意這個要拷貝一個副本,或改名源文件mapred-site.xml.template爲mapred-site.xml
<configuration>
<!--告訴hadoop以後MR運行在yarn上-->
<property>
<name>mapreduce.framework.name</name>
<value>yarn</value>
</property>
</configuration>
第五個:
yarn-site.xml
<configuration>
<property>
<name>yarn.resourcemanager.hostname</name>
<value>localhost</value>
</property>
<property>
<name>yarn.nodemanager.aux-services</name>
<value>mapreduce_shuffle</value>
</property>
</configuration>