运行第一个Hadoop例子

环境:Hadoop 1.2.1
[grid@hadoop1 input]$ echo "hello world" > test1.txt
[grid@hadoop1 input]$ echo "hello hadoop" > test2.txt

[grid@hadoop1 hadoop-1.2.1]$ bin/hadoop fs -put ../input in
[grid@hadoop1 hadoop-1.2.1]$ ./bin/hadoop fs -ls ./in/*
-rw-r--r--   2 grid supergroup         12 2015-01-03 00:15 /user/grid/in/test1.txt
-rw-r--r--   2 grid supergroup         13 2015-01-03 00:15 /user/grid/in/test2.txt

[grid@hadoop1 hadoop-1.2.1]$ ./bin/hadoop jar hadoop-examples-1.2.1.jar wordcount in out
[grid@hadoop1 hadoop-1.2.1]$ ./bin/hadoop fs -ls
Found 2 items
drwxr-xr-x   - grid supergroup          0 2015-01-03 00:15 /user/grid/in
drwxr-xr-x   - grid supergroup          0 2015-01-03 00:18 /user/grid/out
[grid@hadoop1 hadoop-1.2.1]$ ./bin/hadoop fs -ls ./out/*
-rw-r--r--   2 grid supergroup          0 2015-01-03 00:18 /user/grid/out/_SUCCESS
drwxr-xr-x   - grid supergroup          0 2015-01-03 00:18 /user/grid/out/_logs/history
-rw-r--r--   2 grid supergroup         25 2015-01-03 00:18 /user/grid/out/part-r-00000
[grid@hadoop1 hadoop-1.2.1]$ ./bin/hadoop fs -cat ./out/*
hadoop	1
hello	2
world	1
cat: File does not exist: /user/grid/out/_logs





你可能感兴趣的:(运行第一个Hadoop例子)