I am trying to copy the data existing in local machine over to hdfs...But the problem is, I need to preserve the permissions like the file permissions and ownership should not change after copying data to HDFS...Permissions in HDFS should look same as in local machine..
How can I achieve this without manually changing permissions in hadoop using hadoop fs -chmod/-chown.
You would use the -p when doing a put. From the docs:
-put [-f] [-p] <localsrc> ... <dst>: Copy files from the local file system into fs. Copying fails if the file already exists, unless the -f flag is given. Passing -p preserves access and modification times, ownership and the mode. Passing -f overwrites the destination if it already exists.