Hadoop分布式存储和分布式计算的测试
上传文件master(namenode)
[******@master ~]$ hadoop dfs -ls
ls: Cannot access .: No such directory.
创建一个dir1目录,并且创建三个文件
[******@master ~]$ mkdir dir1
[******@master ~]$ echo "hello slave" > dir1/file1
[******@master ~]$ echo "hello world slave1" > dir1/file2
[******@master ~]$ echo "hello slave2 hello" > dir1/file3
[******@master ~]$ hadoop dfs -cat dir1/file1 //查看file1文件内容
hello slave
下载文件到本地
[******@master ~]$ hadoop dfs -ls
Found 2 items
drwxr-xr-x - hadoop supergroup 0 2013-10-30 14:33 /user/hadoop/dir1
-rw-r--r-- 2 hadoop supergroup 1761 2013-10-30 14:31 /user/hadoop/
[******@master ~]$ hadoop dfs -get dir1 /tmp/dir1
[******@master ~]$ ls /tmp/dir1/
file1 file2 file3
在datanode上查看上传的文件
[******@slave1 ~]$ ls /home/hadoop/data/
current detach storage tmp
[******@slave1 ~]$ ll /home/hadoop/data/current/
total 48
-rw-rw-r--. 1 hadoop hadoop 13 Oct 30 14:33 blk_-19692909
-rw-rw-r--. 1 hadoop hadoop 11 Oct 30 14:33 blk_-
-rw-rw-r--. 1 hadoop hadoop 4 Oct 30 14:19 blk_-43263702
-rw-rw-r--. 1 hadoop hadoop 11 Oct 30 14:19 blk_-
-rw-rw-r--. 1 hadoop hadoop 13 Oct 30 14:33 blk_5949419361983275838
-rw-rw-r--. 1 hadoop hadoop 11 Oct 30 14:33
-rw-rw-r--. 1 hadoop hadoop 13 Oct 30 14:33 blk_-5988658523262443
Hadoop分布式存储和分布式计算测试 来自淘豆网m.daumloan.com转载请标明出处.