1.启动 start-dfs.sh?
启动start-yarn.sh
2.输入http://hadoop-0000:50070/,查看HDFS
?
3. ?上传一个文件,比如JDK
hadoop fs -put jdk-8u77-linux-x64.tar.gz hdfs://hadoop-0000:9000/
?
4.查看HDFS
5.下载一个文件
hadoop fs -get hdfs://hadoop-0000:9000/jdk-8u77-linux-x64.tar.gz
?
6. 创建两个目录
hadoop fs -mkdir /wordcount hadoop fs -mkdir /wordcount/input
?
7.新建一个文件,输入一些数据,保存
上传
hadoop fs -put wordcount.txt /wordcount/input
?
8.测试wordcount
hadoop jar hadoop-mapreduce-examples-2.6.4.jar wordcount /wordcount/input /wordcount/output
?
9.查看输出
hadoop fs -ls /wordcount/output
?
?
10.查看结果
hadoop fs -cat /wordcount/output/part-r-00000
?
?
??
?
?
?
?
?
原文:http://agilestyle.iteye.com/blog/2289530