參考文獻:https://my.oschina.net/hetiangui/blog/143364oop
root登入集羣后:ui
chown -R newday:newday /usr/local/hadoop //個人yong用戶名是newday,集羣的安裝目錄是/usr/local/hadoop
mkdir /tmp/hadoopfile/hadoop-newday
chown -R newday:newday /tmp/hadoopfile/hadoop-newday
hadoop fs -chown -R newday /Anewday
source /usr/local/hadoop/conf/hadoop-env.sh
和文章中不一樣的是,在最後運行代碼是提示,permission denied的錯誤,最後使用下面代碼,而不是參考文章中的/tmpspa
hadoop fs -chmod 777 /
也可能緣由,我配置了環境變量爲HADOOP_USER_NAME,根據這篇文章:http://www.huqiwen.com/2013/07/18/hdfs-permission-denied/.net