时间:2021-07-01 10:21:17 帮助过:26人阅读
";}?>
#!/bin/bashecho "wordCount test start"rm -rf ~/file_20141024mkdir ~/file_20141024cd ~/file_20141024echo "Hello World" > file1.txtecho "Hello China Beijing" > file2.txtcd /home/work/hadoop/bin ./hadoop dfs -rmr input_20141024./hadoop dfs -rmr output_20141024./hadoop fs -mkdir input_20141024#hadoop fs -chomod -R 777 /input_20141024./hadoop fs -put ~/file_20141024/file*.txt input_20141024./hadoop jar /home/work/hadoop/hadoop-examples-1.1.2.jar wordcount input_20141024 output_20141024./hadoop fs -ls output_20141024./hadoop fs -cat output_20141024/part-r-00000echo "wordCount test end"
查询结果:
/user/work/output_20141024/part-r-00000 Beijing 1 China 1 Hello 2 World 1