Monday, January 30, 2017

hadoop: uploading the files

for putting files on hadoop use
 hadoop fs -put /<local machime path> /<hdfs path>
and to get files from hadoop use
 hadoop fs -get /<hdfs path> /<local machime path>

example
mkdir ~/temp/hadoopy/playground
cd ~/temp/hadoopy/playground
wget https://raw.github.com/bwhite/hadoopy/master/examples/data/wc-input-alice.tb
wget https://raw.github.com/bwhite/hadoopy/master/examples/data/wc-input-alice.txt
wget https://raw.github.com/bwhite/hadoopy/master/examples/data/wc-input-alice.txt.gz
cd ~/temp/hadoopy
copy local files to HDFS::
hadoop fs -put ~/temp/hadoopy/playground playground
list them out
hadoop fs -ls playground
Found 3 items
-rw-r--r--   1 taericks supergroup     259835 2011-11-18 14:58 /user/taericks/playground/wc-input-alice.tb
-rw-r--r--   1 taericks supergroup     167529 2011-11-18 14:58 /user/taericks/playground/wc-input-alice.txt
-rw-r--r--   1 taericks supergroup      60638 2011-11-18 14:58 /user/taericks/playground/wc-input-alice.txt.gz
Reference
1

No comments:

Post a Comment