可以使用CM提供的api查询cdh集群的信息
1 | http://cloudera.github.io/cm_api/ |
7.0.3的api文档
1 | https://archive.cloudera.com/cm7/7.0.3/generic/jar/cm_api/apidocs/index.html |
查询impala query的api
1 | https://archive.cloudera.com/cm7/7.0.3/generic/jar/cm_api/apidocs/json_ApiImpalaQuery.html |
比如
1 | https://xxxx:7180/api/v9/clusters/dev-cdh/services/impala/impalaQueries?from=2020-03-10T06:26:01.927Z |
支持的参数如图所示
查询yarn上query的api
1 | https://archive.cloudera.com/cm7/7.0.3/generic/jar/cm_api/apidocs/resource_YarnApplicationsResource.html |
比如
1 | https://xxxx:7180/api/v9/clusters/dev-cdh/services/yarn/yarnApplications |
支持的参数如图所示,和impala的一样
查询组件的日志log的api
1 | https://archive.cloudera.com/cm7/7.0.3/generic/jar/cm_api/apidocs/resource_RolesResource.html |
比如
1 | https://xxxx:7180/api/v9/clusters/dev-cdh/services/hive/roles/hive-HIVESERVER2-xxxx/logs/full |
其中的roleName通过下面的接口请求
1 | https://xxxx:7180/api/v9/clusters/dev-cdh/services/hive/roles |