Changes between Initial Version and Version 1 of III140614/Lab4


Ignore:
Timestamp:
Jun 14, 2014, 3:53:23 PM (10 years ago)
Author:
jazz
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • III140614/Lab4

    v1 v1  
     1[[PageOutline]]
     2
     3◢ <[wiki:III140614/Lab3 實作三]> | <[wiki:III140614 回課程大綱]> ▲ | <[wiki:III140614/Lab5 實作五]> ◣
     4
     5= 實作四 Lab 4 =
     6
     7{{{
     8#!html
     9<div style="text-align: center;"><big style="font-weight: bold;"><big>HDFS 叢集環境操作練習<br/>HDFS full distributed mode in practice</big></big></div>
     10}}}
     11
     12{{{
     13#!text
     14以下練習,請連線至 hadoop.3du.me 操作。底下的 userXX 等於您的用戶名稱。
     15}}}
     16
     17== 準備工作 ==
     18
     19 * 保障您自己使用的權利,請先修改密碼:
     20{{{
     21user0@hdp:~$ passwd                                                           
     22Changing password for user0.                                                 
     23(current) UNIX password:                                                     
     24Enter new UNIX password:                                                     
     25Retype new UNIX password:
     26}}}
     27
     28== 產生目錄 ==
     29
     30{{{
     31user0@hdp:~$ hadoop fs -ls                                                   
     32user0@hdp:~$ hadoop fs -mkdir tmp                                             
     33user0@hdp:~$ hadoop fs -ls                                                   
     34Found 1 items                                                                 
     35drwxr-xr-x   - user0 supergroup          0 2014-03-23 02:04 /user/user0/tmp   
     36}}}
     37
     38== 產生一個 100 MB 的檔案 ==
     39
     40{{{
     41user0@hdp:~$ dd if=/dev/zero of=100mb.img bs=1M count=100                     
     42100+0 records in                                                             
     43100+0 records out                                                             
     44104857600 bytes (105 MB) copied, 0.0589096 s, 1.8 GB/s                       
     45user0@hdp:~$ hadoop fs -put 100mb.img test.img                               
     46user0@hdp:~$ hadoop fs -ls                                                   
     47Found 2 items                                                                 
     48-rw-r--r--   1 user0 supergroup  104857600 2014-03-23 02:08 /user/user0/test.img
     49drwxr-xr-x   - user0 supergroup          0 2014-03-23 02:04 /user/user0/tmp
     50}}}
     51
     52== 觀察 block 分佈情形 ==
     53
     54{{{
     55user0@hdp:~$ hadoop fsck /user/$USER/test.img -files -blocks -locations       
     56FSCK started by user0 from /10.240.1.123 for path /user/$USER/test.img at Sun
     57Mar 23 02:11:08 UTC 2014                                                     
     58/user/user0/test.img 104857600 bytes, 2 block(s):  OK                         
     590. blk_-4422576463029178583_1044 len=67108864 repl=1 [10.240.1.123:50010]     
     601. blk_7793285600029540175_1044 len=37748736 repl=1 [10.240.1.123:50010]     
     61                                                                             
     62Status: HEALTHY                                                               
     63 Total size:    104857600 B                                                   
     64 Total dirs:    0                                                             
     65 Total files:   1                                                             
     66 Total blocks (validated):      2 (avg. block size 52428800 B)               
     67 Minimally replicated blocks:   2 (100.0 %)                                   
     68 Over-replicated blocks:        0 (0.0 %)                                     
     69 Under-replicated blocks:       0 (0.0 %)                                     
     70 Mis-replicated blocks:         0 (0.0 %)                                     
     71 Default replication factor:    1                                             
     72 Average block replication:     1.0                                           
     73 Corrupt blocks:                0                                             
     74 Missing replicas:              0 (0.0 %)                                     
     75 Number of data-nodes:          9                                             
     76 Number of racks:               1                                             
     77FSCK ended at Sun Mar 23 02:11:08 UTC 2014 in 9 milliseconds                 
     78                                                                             
     79                                                                             
     80The filesystem under path '/user/$USER/test.img' is HEALTHY                   
     81}}}
     82
     83== 修改副本個數 ==
     84
     85{{{
     86user0@hdp:~$ hadoop fs -setrep 2 /user/$USER/test.img                         
     87Replication 2 set: hdfs://hdp:9000/user/$USER/test.img
     88user0@hdp:~$ hadoop fsck /user/$USER/test.img -files -blocks -locations       
     89FSCK started by user0 from /10.240.1.123 for path /user/$USER/test.img at Sun
     90Mar 23 02:45:11 UTC 2014                                                     
     91/user/$USER/test.img 104857600 bytes, 2 block(s):  OK                         
     920. blk_-4422576463029178583_1044 len=67108864 repl=2 [10.240.1.123:50010, 10.2
     9340.174.73:50010]                                                             
     941. blk_7793285600029540175_1044 len=37748736 repl=2 [10.240.1.123:50010, 10.24
     950.116.151:50010]                                                             
     96                                                                             
     97Status: HEALTHY                                                               
     98 Total size:    104857600 B                                                   
     99 Total dirs:    0                                                             
     100 Total files:   1                                                             
     101 Total blocks (validated):      2 (avg. block size 52428800 B)               
     102 Minimally replicated blocks:   2 (100.0 %)                                   
     103 Over-replicated blocks:        0 (0.0 %)                                     
     104 Under-replicated blocks:       0 (0.0 %)                                     
     105 Mis-replicated blocks:         0 (0.0 %)                                     
     106 Default replication factor:    1                                             
     107 Average block replication:     2.0                                           
     108 Corrupt blocks:                0                                             
     109 Missing replicas:              0 (0.0 %)                                     
     110 Number of data-nodes:          9                                             
     111 Number of racks:               1                                             
     112FSCK ended at Sun Mar 23 02:45:11 UTC 2014 in 0 milliseconds                 
     113                                                                             
     114                                                                             
     115The filesystem under path '/user/$USER/test.img' is HEALTHY                   
     116}}}