1. 程式人生 > >Hadoop 2.6.5 Windows環境下安裝

Hadoop 2.6.5 Windows環境下安裝

打包好的已配置好的hadoop 2.6.5 其中包括重要的幾個dll檔案是hadoop不自帶的。

連結:http://pan.baidu.com/s/1i4YfUID 密碼:1jfl

windows下安裝並啟動hadoop2.6.5

  64位windows安裝hadoop沒必要倒騰Cygwin,直接解壓官網下載hadoop安裝包到本地->最小化配置4個基本檔案->執行1條啟動命令->完事。一個前提是你的電腦上已經安裝了jdk,設定了java環境變數。下面把這幾步細化貼出來,以hadoop2.6.5為例


  1、下載hadoop安裝包就不細說了:http://hadoop.apache.org/->左邊點Releases->點mirror site->點http://mirrors.tuna.tsinghua.edu.cn/apache/hadoop/common->下載hadoop-2.6.5.tar.gz;


  2、解壓也不細說了:複製到D盤根目錄直接解壓,出來一個目錄D:\hadoop-2.6.5,配置到環境變數HADOOP_HOME中,在PATH里加上%HADOOP_HOME%\bin;下載相關工具類,直接解壓後把檔案丟到D:\hadoop-2.6.5\bin目錄中去,將其中的hadoop.dll在c:/windows/System32下也丟一份;

  3、去D:\hadoop-2.6.5\etc\hadoop找到下面4個檔案並按如下最小配置貼上上去:

core-site.xml



<configuration>
    <property>
        <name>fs.defaultFS</name>
        <value>hdfs://localhost:9000</value>
    </property>    
</configuration>

hdfs-site.xml
<configuration>
    <property>
        <name>dfs.replication</name>
        <value>1</value>
    </property>
    <property>    
        <name>dfs.namenode.name.dir</name>    
        <value>file:/hadoop/data/dfs/namenode</value>    
    </property>    
    <property>    
        <name>dfs.datanode.data.dir</name>    
        <value>file:/hadoop/data/dfs/datanode</value>  
    </property>
</configuration>


mapred-site.xml

<configuration>
    <property>
        <name>mapreduce.framework.name</name>
        <value>yarn</value>
    </property>
</configuration>

yarn-site.xml
<configuration>
    <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>


4、啟動windows命令列視窗,進入hadoop-2.6.5\bin目錄,執行下面2條命令,先格式化namenode再啟動hadoop



D:\hadoop-2.6.5\bin>hadoop namenode -format




D:\hadoop-2.6.5\bin>cd ..\sbin


D:\hadoop-2.6.5\sbin>start-all.cmd
This script is Deprecated. Instead use start-dfs.cmd and start-yarn.cmd
starting yarn daemons


D:\hadoop-2.6.5\sbin>jps
4944 DataNode
5860 NodeManager
3532 Jps
7852 NameNode
7932 ResourceManager