HDFS 和 YARN的常用命令
一怀估、hdfs常用命令
1) 查看幫助 hdfs dfs -help
2) 查看當(dāng)前目錄信息 hdfs dfs -ls /
3) 上傳文件 hdfs dfs -put /本地路徑 /hdfs路徑
4) 下載文件到本地 hdfs dfs -get /hdfs路徑 /本地路徑
5) 創(chuàng)建目錄 hdfs dfs -mkdir /目錄名
6) 移動(dòng)hdfs文件 hdfs dfs -mv /hdfs路徑 /hdfs路徑
7) 復(fù)制hdfs文件 hdfs dfs -cp /hdfs路徑 /hdfs路徑
8) 刪除hdfs文件 hdfs dfs -rm /aa.txt
9) 刪除hdfs目錄 hdfs dfs -rm -r /目錄名
10)查看hdfs中的文件 hdfs dfs -cat /文件 和 hdfs dfs -tail -f /文件
11)創(chuàng)建多級(jí)文件夾 hdfs dfs -mkdir -p /目錄名1/目錄名2
12)合并下載 hdfs dfs -getmerge /hdfs路徑文件夾 /合并后的文件
13)剪切文件 hdfs dfs -moveFromLocal a.txt /aa.txt
14)查看文件夾中有多少個(gè)文件 hdfs dfs -count /目錄名
15)查看hdfs的總空間 hdfs dfs -df / 和 hdfs dfs -df -h /
16)修改副本數(shù) hdfs dfs -setrep 數(shù)量 /文件
二池凄、yarn常用命令
- 打印hadoop的版本 yarn version
- 查看CLASSPATH yarn classpath
- 運(yùn)行jar文件 yarn jar <jar> [mainClass] args...
- 打印節(jié)點(diǎn)的報(bào)告 yarn node [-all | -list | -list -states <States> | -status <NodeId>]
- 打印container(s)的報(bào)告 yarn container [-help | -list <Application Attempt Id> | -status <ContainerId>]
- 打印application信息 yarn application [-list | -list -appStates <States> | -list -appTypes <Types> | -status <ApplicationId>]