-
首先开启hdfs 和 yarn
sbin/start-dfs.sh sbin/start-yarn.sh
-
在 hdfs 上创建目录
hdfs dfs -mkdir -p /wordcount/input
-
在linux 下创建 a.log b.txt 两个文件,再把两个文件通过put 上传至 hdfs
hdfs dfs -put a.log /wordcount/input hdfs dfs -put b.txt /wordcount/input
-
寻找到 example 示例
find ./ -name '*example*.jar'
- 运行 示例
hadoop jar ./share/hadoop/mapreduce1/hadoop-examples-2.6.0-mr1-cdh5.7.0.jar wordcount /wordcount/input /wordcount/output