第1关 HDFS的基本操作
pwd
回车
cd /
回车
mkdir /develop
回车
mkdir /develop/input
回车
mkdir /develop/output
回车
start-dfs.sh
回车
hadoop fs -mkdir /usr
回车
hadoop fs -mkdir /usr/input
回车
hadoop fs -mkdir /usr/output
回车
hadoop fs -ls /
回车
hadoop fs -ls /usr
回车
cd /develop/input
回车
touch helloworld.txt
回车
vim helloworld.txt
回车
hello hadoop
退出 :wq
hadoop fs -put helloworld.txt /usr/output
回车
hadoop fs -cat /usr/output/helloworld.txt
回车
hadoop fs -ls /user/hadoop
回车
hadoop fs -ls /
回车
hadoop fs -ls /usr
回车
hadoop fs -ls /user
回车
hadoop fs -mv /usr/output/helloworld.txt /
回车
hadoop fs -ls /
回车
hadoop fs -rm /helloworld.txt
回车
hadoop fs -mkdir /usr/output
回车
touch hello.txt
回车
vim hello.txt
回车
HDFS 的块比磁盘的块大,其目的是为了最小化寻址开销。
退出 wq
hadoop fs -put hello.txt /usr/output
回车
hadoop fs -ls /usr/output
回车
hadoop fs -rm -r /user/hadoop
回车
hadoop fs -get /usr/output/hello.txt /usr/local
回车
ls /usr/local
第2关