| | 126 | |
| | 127 | * 看har裡面的檔案結構 |
| | 128 | {{{ |
| | 129 | $ bin/hadoop dfs -lsr /user/waue/output/foo.har |
| | 130 | }}} |
| | 131 | * 看har內檔案的內容 |
| | 132 | {{{ |
| | 133 | $ bin/hadoop dfs -cat /user/waue/output/foo.har/part-0 |
| | 134 | }}} |
| | 135 | |
| | 136 | * ps: 官方文件介紹的 hadoop dfs -lsr har:///user/hadoop/output/foo.har 會出現錯誤! |
| | 137 | {{{ |
| | 138 | #!sh |
| | 139 | lsr: could not get get listing for 'har:/user/waue/output/foo.har/user/waue' : File: har://hdfs-gm1.nchc.org.tw:9000/user/waue/output/foo.har/user/waue/input does not exist in har:///user/waue/output/foo.har |
| | 140 | |
| | 141 | }}} |
| | 142 | |
| | 143 | == distCp == |
| | 144 | * 是用於大規模集群內部和集群之間拷貝的工具 |
| | 145 | * 使用Map/Reduce實現文件分發,錯誤處理和恢復,以及報告生成 |
| | 146 | * 舉例為: |
| | 147 | {{{ |
| | 148 | hadoop distcp hdfs://nn1:8020/foo/bar hdfs://nn2:8020/bar/foo |
| | 149 | }}} |
| | 150 | ?? 然而8020 port 在機器上沒有開,且不是應該檔案會均勻散佈在每個節點上嗎?怎麼還會知道nn1的節點上有這個檔要複製到nn2呢? |