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.
- run
chmod 755 -r /root
. change permissions on directory , file recursively. not recommended open permission on root home directory. - then can run copyfromlocal
sudo -u hdfs
copy file local file system hdfs.
better practice create user space root , copy files directly root.
sudo -u hdfs hadoop fs -mkdir /user/root
sudo -u hdfs hadoop fs -chown root:root /user/root
- hadoop fs -copyfromlocal
Comments
Post a Comment