Hadoop Windows環境下安裝
打包好的已配置好的hadoop 我這裡用的是2.6.5 其中包括重要的幾個dll檔案是hadoop不自帶的。
連結:https://pan.baidu.com/s/1Mct3sLTyXFuO3G8slafrKA 密碼:4sf1
配置到環境變:
環境變量HADOOP_HOME中是安裝的路徑,在PATH里加上%HADOOP_HOME%\bin;下載相關工具類,直接解壓後把檔案丟到E:\hadoop-2.6.5\bin目錄中去,將其中的hadoop.dll在c:/windows/System32下也丟一份;
用記事本開啟 hadoop2.6.5\etc\hadoop\hadoop-env.cmd檔案,修改JAVA_HOME為你自己jdk路徑。
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、解壓也不細說了:複製到E盤根目錄直接解壓,出來一個目錄E:\hadoop-2.6.5
3、去E:\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
E:\hadoop-2.6.5\bin>hadoop namenode -format
E:\hadoop-2.6.5\bin>cd ..\sbin
E:\hadoop-2.6.5\sbin>start-all.cmd
This script is Deprecated. Instead use start-dfs.cmd and start-yarn.cmd
starting yarn daemons
E:\hadoop-2.6.5\sbin>jps
4944 DataNode
5860 NodeManager
3532 Jps
7852 NameNode
7932 ResourceManager