(適用於hadoop 2.7及以上版本)html
ResourceManager REST API’s:
https://hadoop.apache.org/docs/stable/hadoop-yarn/hadoop-yarn-site/ResourceManagerRest.htmlweb
WebHDFS REST API:
https://hadoop.apache.org/docs/stable/hadoop-project-dist/hadoop-hdfs/WebHDFS.htmlapache
MapReduce History Server REST API’s:
https://hadoop.apache.org/docs/stable/hadoop-mapreduce-client/hadoop-mapreduce-client-hs/HistoryServerRest.htmlide
Spark Monitoring and Instrumentation
http://spark.apache.org/docs/latest/monitoring.htmloop
URL
http://emr-header-1:50070/webhdfs/v1/?user.name=hadoop&op=GETCONTENTSUMMARYui
返回結果:this
{"ContentSummary": {"directoryCount": 2,"fileCount" : 1,"length" : 24930,"quota" : -1,"spaceConsumed" : 24930,"spaceQuota" : -1} }
關於返回結果的說明:spa
{"name" : "ContentSummary","properties": {"ContentSummary": { "type" : "object", "properties": { "directoryCount": { "description": "The number of directories.", "type" : "integer", "required" : true }, "fileCount": { "description": "The number of files.", "type" : "integer", "required" : true }, "length": { "description": "The number of bytes used by the content.", "type" : "integer", "required" : true }, "quota": { "description": "The namespace quota of this directory.", "type" : "integer", "required" : true }, "spaceConsumed": { "description": "The disk space consumed by the content.", "type" : "integer", "required" : true }, "spaceQuota": { "description": "The disk space quota.", "type" : "integer", "required" : true } } } } }
注意length與spaceConsumed的關係,跟hdfs副本數有關。orm
若是要統計各個組工做目錄的使用狀況,使用以下請求:
htm
http://emr-header-1:50070/webhdfs/v1/user/feed_aliyun?user.name=hadoop&op=GETCONTENTSUMMARY