Hadoop on cloudera quickstart vm test example 01 wordcount
mkdir temp
cd temp
ls -ltr
echo "this is huiming and you can call me juiming or killniu i am good at statistical modeling and data analysis" > wordcount.txt
hdfs dfs -mkdir /user/cloudera/input
hdfs dfs -ls /user/cloudera/input
hdfs dfs -put /home/cloudera/temp/wordcount.txt /user/cloudera/input
hdfs dfs -ls /user/cloudera/input
應該會出現剛剛創造的wordcount.txt
ls -ltr /usr/lib/hadoop-mapreduce/
hadoop jar /usr/lib/hadoop-mapreduce/hadoop-mapreduce-example.jar
hadoop jar /usr/lib/hadoop-mapreduce/hadoop-mapreduce-example.jar wordcount /user/cloudera/input/wordcount.txt /user/cloudera/output
hdfs dfs -ls /user/cloudera/output
hdfs dfs -cat /user/cloudera/output/part-r-00000
最後就會跑出word count囉
沒有留言:
張貼留言