Saturday 2 January 2016

Hadoop: put: copy multiple files from local system to HDFS.

“put” command is used to copy multiple files from local system to HDFS.

Usage:
hadoop fs [generic options] -put [-f] [-p] [-l] <localsrc> ... <dst>
 
$ls
apacheNifi.docx  atlasClient.docx  atlas.docx  a.txt  b.txt  c.txt  d.txt  gradle.docx  maven.docx
$
$hadoop fs -mkdir /user/cloudera/putDemo
$
$hadoop fs -ls /user/cloudera/putDemo
$
$hadoop fs -put apacheNifi.docx a.txt b.txt /user/cloudera/putDemo
22/03/23 08:06:50 WARN hdfs.DFSClient: Caught exception 
java.lang.InterruptedException
	at java.lang.Object.wait(Native Method)
	at java.lang.Thread.join(Thread.java:1281)
	at java.lang.Thread.join(Thread.java:1355)
	at org.apache.hadoop.hdfs.DFSOutputStream$DataStreamer.closeResponder(DFSOutputStream.java:967)
	at org.apache.hadoop.hdfs.DFSOutputStream$DataStreamer.endBlock(DFSOutputStream.java:705)
	at org.apache.hadoop.hdfs.DFSOutputStream$DataStreamer.run(DFSOutputStream.java:894)
$
$hadoop fs -ls /user/cloudera/putDemo
Found 3 items
-rw-r--r--   1 cloudera cloudera          2 2022-03-23 08:06 /user/cloudera/putDemo/a.txt
-rw-r--r--   1 cloudera cloudera    4724690 2022-03-23 08:06 /user/cloudera/putDemo/apacheNifi.docx
-rw-r--r--   1 cloudera cloudera         35 2022-03-23 08:06 /user/cloudera/putDemo/b.txt
$




Previous                                                 Next                                                 Home

No comments:

Post a Comment