HDFS常用命令

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

请使用浏览器的分享功能分享到微信等