Problem Description
When Linux uploads a local file to HDFS, "No such file or directory" appears
but you find that the file exists in
the current folder. At this time, you may be worried about whether it is a file permission problem, because we are using the hdfs command , Switch to the hdfs user, but the user and user group of the current file is root, so we modify the user and user group of this file to hdfs and try again.
You can see that the same error is reported, and then the same error is reported. Method to modify the user and user group of the folder where this file is located to hdfs, still not working
Solution
After modifying the user and user group of the folder where this file is located to hdfs, move to the root directory to complete
or modify all upper parent directories of the file you want to upload to hdfs users and user groups
Reason explanation
When uploading files in HDFS, the default is to start from the root directory, step by step to find the directory where the file to be uploaded is located. If there is a directory in the middle that is not hdfs, the search is aborted, resulting in the file being unable to be found, and finally it will appear that the file exists, but Error "No such file or directory" is reported.