為了方便采用了Cygwin模擬linux環境的方法
一、安裝JDK以及下載hadoop
hadoop官網下載hadoop http://hadoop.apache.org/releases.html 。
二、安裝Cygwin
1、http://www.cygwin.com/ 根據操作系統的需要下載32位或64的安裝文件。
2、雙擊下載好的安裝文件進入安裝引導頁,選擇從網絡安裝
3、選擇安裝路徑
4、選擇internet連接方式
5、選擇合適的安裝源
6、選擇需要安裝的軟件包
net下的openssh和openssl
Base下的sed
Editors下的vim
7、等待安裝完成
8、配置環境變量
9、安裝sshd服務
啟動Cygwin執行ssh-host-config - y
出現下述文字表示安裝成功
10、啟動sshd服務
net start sshd
三、安裝hadoop
1、下載hadoop並解壓
http://hadoop.apache.org/releases.html
2、單機模式配置
單機模式不需要進行配置,這種方式下,Hadoop被認為是一個單獨的Java進程,經常用來進行調試。
3、偽分布模式
偽分布模式可以看做是只有一個節點的集群,在這個集群中,這個節點既是Master也是Slave,既是NameNode也是DataNode,既是JobTracket也是TaskTranker.
偽分布式需要修改配置文件hadoop-env.sh core-site.xml hdfs-site.xml mapred-site.xml
<!--core-site--> <configuration> <property> <name>fs.default.name</name> <value>hdfs://localhost:9999</value> </property> <property> <name>mapred.child.tmp</name> <value>/cygdrive/d/hadoop/hadoop-2.8.0/tmp</value> </property> </configuration>
<!--hdfs-site--> <configuration> <property> <name>dfs.replication</name> <value>1</value> </property> </configuration><!--mapred-site.xml--> <configuration> <property> <name>mapred.job.tracker</name> <value>localhost:9998</value> </property> <property> <name>mapred.child.tmp</name> <value>/cygdrive/d/hadoop/hadoop-2.8.0/tmp</value> </property> </configuration>4、啟動hadoop
打開cygwin窗口,進入hadoop文件夾,啟動hadoop之前需要先格式化Hadoop的文件系統HDFS,執行命令 bin/hadoop namenoce -format





