[[PageOutline]]
◢ <[wiki:Hinet130923/Lab3 實作三]> | <[wiki:Hinet130923 回課程大綱]> ▲ | <[wiki:Hinet130923/Lab5 實作五]> ◣
= 實作四 Lab 4 =
{{{
#!html
HDFS 基本指令操作練習
HDFS in practice (full distributed mode)
}}}
== Content 1: HDFS Shell 基本操作 ==
== Content 1: Basic HDFS Shell Commands ==
=== 1.1 瀏覽你HDFS目錄 ===
=== 1.1 Browsing Your HDFS Folder ===
{{{
~$ hadoop fs -ls
}}}
=== 1.2 上傳資料到 HDFS 目錄 ===
=== 1.2 Upload Files or Folder to HDFS ===
* 上傳 Upload
{{{
~$ hadoop fs -put /opt/hadoop/conf input
}}}
* 檢查 Check
{{{
~$ hadoop fs -ls
}}}
=== 1.3 下載 HDFS 的資料到本地目錄 ===
=== 1.3 Download HDFS Files or Folder to Local ===
* 下載 Download
{{{
~$ hadoop fs -get input fromHDFS
}}}
* 檢查 Check
{{{
~$ ls -al | grep fromHDFS
~$ diff /opt/hadoop/conf fromHDFS/
}}}
=== 1.4 刪除檔案 ===
=== 1.4 Remove Files or Folder ===
{{{
~$ hadoop fs -ls input/masters
~$ hadoop fs -rm input/masters
}}}
=== 1.5 直接看檔案 ===
=== 1.5 Browse Files Directly ===
{{{
~$ hadoop fs -ls input/slaves
~$ hadoop fs -cat input/slaves
}}}
=== 1.6 更多指令操作 ===
=== 1.6 More Commands -- Help message ===
{{{
~$ hadoop fs
Usage: java FsShell
[-ls ]
[-lsr ]
[-du ]
[-dus ]
[-count[-q] ]
[-mv ]
[-cp ]
[-rm ]
[-rmr ]
[-expunge]
[-put ... ]
[-copyFromLocal ... ]
[-moveFromLocal ... ]
[-get [-ignoreCrc] [-crc] ]
[-getmerge [addnl]]
[-cat ]
[-text ]
[-copyToLocal [-ignoreCrc] [-crc] ]
[-moveToLocal [-crc] ]
[-mkdir ]
[-setrep [-R] [-w] ]
[-touchz ]
[-test -[ezd] ]
[-stat [format] ]
[-tail [-f] ]
[-chmod [-R] PATH...]
[-chown [-R] [OWNER][:[GROUP]] PATH...]
[-chgrp [-R] GROUP PATH...]
[-help [cmd]]
Generic options supported are
-conf specify an application configuration file
-D use value for given property
-fs specify a namenode
-jt specify a job tracker
-files specify comma separated files to be copied to the map reduce cluster
-libjars specify comma separated jar files to include in the classpath.
-archives specify comma separated archives to be unarchived on the compute machines.
The general command line syntax is
hadoop command [genericOptions] [commandOptions]
}}}
== Content 2: 使用網頁 GUI 瀏覽資訊 ==
== Content 2: User Web GUI to browse HDFS ==
* 連上 http://nodeN.3du.me:50070 的 NameNode Web Interface ,請將 N 取代為您的報名序號