phoenix13

导航

 

1. load file into hdfs

hadoop fs -put src  dest

example: load a fold "input" into hdfs "input1" folder, "input1" folder must not already exist

you can not load a single file when folder is not exist

hadoop fs -put /mnt/hgfs/input  input1

when folder is already exist, you can put single file into folder

hadoop fs -put /mnt/hgfs/input/a.txt  input1

2. list file in hdfs

hadoop fs -ls
hadoop fs -ls input

3. open file in hdfs

example: open all file in output folder

 hadoop fs -cat output/*

4. run a jar file in hadoop(class name must include package name)

hadoop jar hello.jar package_name.Class_name  args...

 example:

 hadoop jar ha-0.0.1-SNAPSHOT.jar ha.WordCount input/wcInput.txt output3

 

posted on 2015-04-22 08:28  phoenix13  阅读(187)  评论(0编辑  收藏  举报