WordCount案例
作者:互联网
创建测试文件
mkdir file
cd file/
echo "Hello word" > file1.txt
echo "Hello a word" > file2.txt
创建HDFS目录
cd ~/hadoop/
sbin/start-all.sh
bin/hadoop fs -mkdir /input2
上传测试文本
cd ~/file
../hadoop/bin/hadoop fs -put file* /input2/
../hadoop/bin/hadoop fs -ls /input2/
执行WordCount
cd ~/hadoop
bin/hadoop jar share/hadoop/mapreduce/hadoop-mareduce-examples-3.2.2.jar wordcount /input2 /output2/wordcount1
bin/hadoop fs -cat /output2/wordcount1
标签:bin,input2,fs,WordCount,hadoop,cd,案例,file 来源: https://blog.csdn.net/weixin_46329906/article/details/116330568