通过hadoop自带的demo运行单词统计

2023-02-25 15:13:55 浏览数 (1)

代码语言:javascript复制
mkdir input
cd  intput
echo “hello word” > file1.txt
echo “hello hadoop” > file2.txt
echo “hello mapreduce” >> file2.txt
more file2.txt
hdfs dfs -mkdir  /wc_input
hdfs dfs -ls /
hdfs dfs -put ~/input/fi* /wc_input
hdfs dfs -ls  /wc_input
hadoop jar share/hadoop/mapreduce/hadoop-mapreduce-examples-2.7.3.jar wordcount /wc_input /output
hdfs dfs -ls /output
hdfs dfs -cat /output/part-r-00000

0 人点赞