hadoop HTTP 查询 JMX

默认端口说明
日志里有端口的用途

9864: DatanodeHttpServer; DataNode Information
9866: streaming server
9867: IPC server
9868: Web-server for secondary; SecondaryNamenode information
9870: Web-server for hdfs; Namenode information
41409: Jetty; Hadoop Administration
9000: nameNode通信端口,上传数据块注册信息

在Namenode information的web端口(默认9870)访问JMX

在页面的Utilites->metrics

http://192.168.19.160:9870/jmx

//通过qry参数来过滤MXBeanName(即json的name字段)
http://192.168.19.160:9870/jmx?qry=Hadoop:*
//查询具体的name
http://192.168.19.160:9870/jmx?qry=Hadoop:service=NameNode,name=JvmMetrics
//查询具体的属性: MXBeanName::AttributeName
http://192.168.19.160:9870/jmx?get=Hadoop:service=NameNode,name=JvmMetrics::tag.Hostname

json格式的返回

{
  "beans" : [ {
    "name" : "Hadoop:service=NameNode,name=JvmMetrics",
    "modelerType" : "JvmMetrics",
    "tag.Context" : "jvm",
    "tag.ProcessName" : "NameNode",
    "tag.SessionId" : null,
    "tag.Hostname" : "localhost",
    "MemNonHeapUsedM" : 48.131035,
    "MemNonHeapCommittedM" : 49.28125,
    "MemNonHeapMaxM" : -1.0,
    "MemHeapUsedM" : 21.058708,
    "MemHeapCommittedM" : 42.10547,
    "MemHeapMaxM" : 440.8125,
    "MemMaxM" : 440.8125,
    "GcCountCopy" : 39,
    "GcTimeMillisCopy" : 148,
    "GcCountMarkSweepCompact" : 2,
    "GcTimeMillisMarkSweepCompact" : 133,
    "GcCount" : 41,
    "GcTimeMillis" : 281,
    "GcNumWarnThresholdExceeded" : 0,
    "GcNumInfoThresholdExceeded" : 0,
    "GcTotalExtraSleepTime" : 826,
    "ThreadsNew" : 0,
    "ThreadsRunnable" : 6,
    "ThreadsBlocked" : 0,
    "ThreadsWaiting" : 6,
    "ThreadsTimedWaiting" : 35,
    "ThreadsTerminated" : 0,
    "LogFatal" : 0,
    "LogError" : 0,
    "LogWarn" : 2,
    "LogInfo" : 136
  }, ... ]
}

各字段的解释

https://cwiki.apache.org/confluence/display/EAG/Hadoop+JMX+Monitoring+and+Alerting#HadoopJMXMonitoringandAlerting-MetricsCollector

你可能感兴趣的:(prometheus监控系统,CDH,大数据问题处理)