1.下载windows环境下编译的hadoop-2.7.2.x64win.zip
2.解压至D:BigDatahadoop-2.7.2
3.修改D:BigDatahadoop-2.7.2etchadoophadoop-env.cmd
set HADOOP_PREFIX=D:igdatahadoop-2.7.2
4.初始化环境变量
D:BigDatahadoop-2.7.2etchadoop>hadoop-env.cmd
5.格式化namenode
D:BigDatahadoop-2.7.2in>hdfs namenode -format
成功会出现:successfully formatted
6.启动namenode和datanode
D:BigDatahadoop-2.7.2sbin>start-dfs.cmd
查看是否启动成功,在原先窗口输入jps查看,如图:
测试:运行hdfs命令,上传一个文件,在bin目录下创建myfile.txt文件
执行:D:BigDatahadoop-2.7.2in>hdfs dfs -put myfile.txt /
查看上传的文件信息,执行:
D:BigDatahadoop-2.7.2in>hdfs dfs -ls /
7.启动yarn
D:BigDatahadoop-2.7.2sbin>start-yarn.cmd
输入jps命令可查看当前启动的节点
8.Web端查看hadoop作业
http://localhost:8088/cluster
9.结束hadoop
D:BigDatahadoop-2.7.2sbin>stop-yarn.cmd
D:BigDatahadoop-2.7.2sbin>stop-dfs.cmd
参考网址:http://blog.csdn.net/dream_an/article/details/51862640