案例运行
1.创建目录
[hadoop@hadoop01 hadoop]$bin/hdfs dfs -mkdir/user
[hadoop@hadoop01 hadoop]$bin/hdfs dfs -mkdir/user/hadoop
创建user目录为mapreduce做准备,hadoop目录为你的<username>
2.把etc/hadoop中的文件拷贝到input里
[hadoop@hadoop01 hadoop]$bin/hdfs dfs -put etc/hadoop input
[hadoop@hadoop01 hadoop]$bin/hdfs dfs -ls /user/hadoop/
[hadoop@hadoop01 hadoop]$bin/hdfs dfs -ls /user/hadoop/input/*
3.运行提供的案例
[hadoop@hadoop01 hadoop]$bin/hadoop jar \
>share/hadoop/mapreduce/hadoop-mapreduce-examples-3.3.1.jar \
>grep input output 'dfs[a-z.]+'
这里出错找不到