日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

mkdir: Permission denied: user=root, access=WRITE, inode=/lcy/test5.txt:hdfs:hdfs:drwxr-xr-x

發布時間:2024/3/7 编程问答 25 豆豆
生活随笔 收集整理的這篇文章主要介紹了 mkdir: Permission denied: user=root, access=WRITE, inode=/lcy/test5.txt:hdfs:hdfs:drwxr-xr-x 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

環境:

? ? centos 7

? ? hadoop2.7



今天使用root用戶hadoop上傳文件測試的時候,怎么弄都無法上傳成功,報錯

#hdfs dfs -mkdir -p /lcy/test5.txt

mkdir: Permission denied: user=root, access=WRITE, inode="/lcy/test5.txt":hdfs:hdfs:drwxr-xr-x


這是權限問題,后來更改為hdfs用戶后可以成功上傳,后來分析了原因hadoop官方文檔是這樣說的:

The Hadoop Distributed File System (HDFS) implements a permissions model for files and directories that shares much of the POSIX model.?Each file and directory is associated with an owner and a group.When a file or directory is created, its owner is the user identity of the client process, and its group is the group of the parent directory (the BSD rule).Each client process that accesses HDFS has a two-part identity composed of the user name, and groups list. Whenever HDFS must do a permissions check for a file or directory ‘foo’ accessed by a client process?As of Hadoop 0.22, Hadoop supports two different modes of operation to determine the user’s identity,?specified by the hadoop.security.authentication property:?In this mode of operation, the identity of a client process is determined by the host operating system.?On Unix-like systems, the user name is the equivalent of `whoami`.

意思就是說文件在訪問HDFS的時候,會檢查用戶名和所在的組,創建文件的時候用的是hdfs用戶,所以報錯權限不足


后來修改了hdfs的讀寫權限為777 還是不行


最后搞了半天 ?一句話搞定了:

#sudo -u hdfs hdfs dfs -mkdir -p /lcy/test5.txt


就是首先更換為hdfs用戶 ?然后在hdfs中創建/lcy文件夾,并在lcy文件夾下創建test5.txt文件


打開http://192.168.10.189:50070/explorer.html

看到了令人激動的lcy文件夾和之下的test5.txt文件


完美!



總結

以上是生活随笔為你收集整理的mkdir: Permission denied: user=root, access=WRITE, inode=/lcy/test5.txt:hdfs:hdfs:drwxr-xr-x的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。