hadoop - How to change replication factor while running copyFromLocal command? -


i'm not asking how set replication factor in hadoop folder/file. know following command works flawlessly existing files & folders.

hadoop fs -setrep -r -w 3 <folder-path> 

i'm asking, how set replication factor, other default (which 4 in scenario), while copying data local. i'm running following command,

hadoop fs -copyfromlocal <src> <dest> 

when run above commands, copies data src dest path replication factor 4. want make replication factor 1 while copying data not after copying complete. bascially want this,

hadoop fs -setrep -r 1 -copyfromlocal <src> <dest> 

i tried it, didn't work. so, can done? or i've first copy data replication factor 4 , run setrep command?

according this post , this post (both asking different questions), command seems work:

hadoop fs -d dfs.replication=1 -copyfromlocal <src> <dest> 

the -d option means "use value given property."


Comments