HDFS常用命令

laoma8888發表於2018-08-07

1.hadoop fs == hdfs dfs
hadoop fs -ls /
hadoop fs -lsr
hadoop fs -mkdir /user/hadoop
hadoop fs -put a.txt /user/hadoop/
hadoop fs -get /user/hadoop/a.txt /
hadoop fs -cp src dst
hadoop fs -mv src dst
hadoop fs -cat /user/hadoop/a.txt
hadoop fs -rm /user/hadoop/a.txt
hadoop fs -rmr /user/hadoop
hadoop fs -text /user/hadoop/a.txt
hadoop fs -copyFromLocal localsrc dst 與hadoop fs -put功能類似
hadoop fs -moveFromLocal localsrc dst 將本地檔案上傳到hdfs, 同時刪除本地檔案
2.hdfs dfsadmin
hdfs dfsadmin -report
hdfs dfsadmin -safemode enter | leave | get | wait
hdfs dfsadmin -setBalancerBandwidth 1000
3.hadoop fsck
4.start-balancer.sh

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/31496956/viewspace-2199366/,如需轉載,請註明出處,否則將追究法律責任。

相關文章