| | 1 | [[PageOutline]] |
| | 2 | |
| | 3 | ◢ <[wiki:III131019/Lab9 實作九]> | <[wiki:III131019 回課程大綱]> ▲ | <[wiki:III131019/Lab11 實作十一]> ◣ |
| | 4 | |
| | 5 | = 實作十 Lab10 = |
| | 6 | |
| | 7 | {{{ |
| | 8 | cd ~/hadoop_labs/lab004 |
| | 9 | ant |
| | 10 | hadoop fs -ls |
| | 11 | hadoop jar copyFromLocal.jar doc input |
| | 12 | hadoop fs -ls |
| | 13 | touch test |
| | 14 | hadoop jar copyFromLocal.jar test file |
| | 15 | hadoop fs -ls |
| | 16 | |
| | 17 | export HADOOP_CONF_DIR=~/hadoop/conf.local/ |
| | 18 | hadoop fs -ls |
| | 19 | hadoop jar copyFromLocal.jar doc input |
| | 20 | hadoop fs -ls |
| | 21 | hadoop jar copyFromLocal.jar test file |
| | 22 | hadoop fs -ls |
| | 23 | unset HADOOP_CONF_DIR |
| | 24 | |
| | 25 | ant clean |
| | 26 | }}} |
| | 27 | |
| | 28 | == 實作習題 == |
| | 29 | |
| | 30 | <問題 1> 執行 lab003/FsShell,在單機模式時,srcFs 物件是哪一個 Java 類別 |
| | 31 | {{{ |
| | 32 | #!text |
| | 33 | (A) org.apache.hadoop.fs.LocalFileSystem |
| | 34 | (B) org.apache.hadoop.hdfs.DistributedFileSystem |
| | 35 | (C) org.apache.hadoop.fs.shell.Count |
| | 36 | (D) org.apache.hadoop.fs.shell.CommandFormat |
| | 37 | }}} |
| | 38 | |
| | 39 | <問題 2> 執行 lab003/FsShell,在全分散模式時,srcFs 物件是哪一個 Java 類別 |
| | 40 | {{{ |
| | 41 | #!text |
| | 42 | (A) org.apache.hadoop.fs.LocalFileSystem |
| | 43 | (B) org.apache.hadoop.hdfs.DistributedFileSystem |
| | 44 | (C) org.apache.hadoop.fs.shell.Count |
| | 45 | (D) org.apache.hadoop.fs.shell.CommandFormat |
| | 46 | }}} |
| | 47 | |
| | 48 | <問題 3> 根據 ${HOME}/hadoop/src/core/org/apache/hadoop/fs 目錄的內容,試猜測 Hadoop 1.0.4 支援哪幾種檔案系統: (複選) |
| | 49 | |
| | 50 | <提示> http://answers.oreilly.com/topic/456-get-to-know-hadoop-filesystems/ |
| | 51 | {{{ |
| | 52 | #!text |
| | 53 | (A) HDFS (hdfs://namenode:port) |
| | 54 | (B) Amazon S3 (s3:// , s3n://) |
| | 55 | (C) KFS |
| | 56 | (D) Local File System (file:///) |
| | 57 | (F) FTP (ftp://user:passwd@ftp-server:port) |
| | 58 | (G) RAMFS (ramfs://) |
| | 59 | (H) HAR (Hadoop Archive Filesystem, har://underlyingfsscheme-host:port/archivepath or har:///archivepath ) |
| | 60 | }}} |