hdfs - No such file or directory error when using Hadoop fs --copyFromLocal command -


i have local vm has hortonworks hadoop , hdfs installed on it. ssh'ed vm machine , trying copy file local filesystem hdfs through following set of commands:

[root@sandbox ~]# sudo -u hdfs hadoop fs -mkdir /folder1/ [root@sandbox ~]# sudo -u hdfs hadoop fs -copyfromlocal /root/folder1/file1.txt /hdfs_folder1/ 

when execute following error - copyfromlocal:/root/folder1/file1.txt': no such file or directory

i can see file right in /root/folder1/ directory hdfs command throwing above error. tried cd /root/folder1/ , execute command same error comes. why file not getting found when right there?

by running sudo -u hdfs hadoop fs..., tries read file /root/folder1/file.txt hdfs.

you can this.

  1. run chmod 755 -r /root. change permissions on directory , file recursively. not recommended open permission on root home directory.
  2. then can run copyfromlocal sudo -u hdfs copy file local file system hdfs.

better practice create user space root , copy files directly root.

  1. sudo -u hdfs hadoop fs -mkdir /user/root
  2. sudo -u hdfs hadoop fs -chown root:root /user/root
  3. hadoop fs -copyfromlocal

Comments

Popular posts from this blog

c - How to retrieve a variable from the Apache configuration inside the module? -

c# - Constructor arguments cannot be passed for interface mocks -

python - malformed header from script index.py Bad header -