|
1064 | 1064 | A service is an abstract entity providing a capability in a cluster.
|
1065 | 1065 | Examples of services are HDFS, MapReduce, YARN, and HBase. A service
|
1066 | 1066 | is usually distributed, and contains a set of roles that physically
|
1067 |
| - run on the cluster. A service has its own configuration, status, |
1068 |
| - metrics, and roles. You may issue commands against a service, or |
1069 |
| - against a set of roles in bulk. Additionally, an HDFS service has |
1070 |
| - nameservices, and a MapReduce service has activities. |
| 1067 | + run on the cluster. A service has its own configuration, status and |
| 1068 | + roles. You may issue commands against a service, or against a set |
| 1069 | + of roles in bulk. Additionally, an HDFS service has nameservices, |
| 1070 | + and a MapReduce service has activities. |
1071 | 1071 | <p>
|
1072 | 1072 | All services belong to a cluster (except for the Cloudera Management
|
1073 | 1073 | Service), and is uniquely identified by its name within a Cloudera
|
|
1083 | 1083 | processes.) Once created, a role cannot be reassigned to a different
|
1084 | 1084 | host. You need to delete and re-create it.
|
1085 | 1085 | <p>
|
1086 |
| - A role has its own configuration, status and metrics. API commands on |
1087 |
| - roles are always issued in bulk at the service level. |
| 1086 | + A role has its own configuration and status. API commands on roles |
| 1087 | + are always issued in bulk at the service level. |
1088 | 1088 | </dd>
|
1089 | 1089 | <dt>Role Type</dt>
|
1090 | 1090 | <dd>
|
|
1119 | 1119 | The operation of this service is similar to other Hadoop services, except
|
1120 | 1120 | that the Management Service does not belong to a cluster.
|
1121 | 1121 | </dd>
|
| 1122 | + <dt>Metrics</dt> |
| 1123 | + <dd> |
| 1124 | + <p> |
| 1125 | + A metric is a property that can be measured to quantify the state of an |
| 1126 | + entity or activity, such as the number of open file descriptors or CPU |
| 1127 | + utilization percentage. Full list of metric schema is available through |
| 1128 | + Cloudera Manager API /timeseries/schema endpoint. |
| 1129 | + <p> |
| 1130 | + Cloudera Manager enables retrieving of metric data using a launguage |
| 1131 | + called tsquery. Please see tsquery documentation for more details on |
| 1132 | + how to write a tsquery. |
| 1133 | + </dd> |
1122 | 1134 | </dl>
|
1123 | 1135 |
|
1124 | 1136 | <h2>Debugging the API</h2>
|
|
1504 | 1516 | }
|
1505 | 1517 | }</code>
|
1506 | 1518 |
|
1507 |
| - <h3>Metrics</h3> |
| 1519 | + <h3>Querying metric data</h3> |
1508 | 1520 |
|
1509 |
| - <p>In the Enterprise Edition, you can get metrics related to hosts, |
1510 |
| - services, roles and activities. The call by default fetches data points from |
1511 |
| - the last 5 minutes. |
| 1521 | + <p> |
| 1522 | + Getting dfs capacity metric data for service HDFS-1. |
1512 | 1523 | <code>
|
1513 | 1524 | $ curl -u admin:admin \
|
1514 |
| - 'http://localhost:7180/api/v1/clusters/Cluster%201%20-%20CDH4/services/hdfs1/metrics?metrics=dfs_capacity_used_non_hdfs&metrics=dfs_capacity' |
| 1525 | + 'http://localhost:7180/api/v11/timeseries?query=select%20dfs_capacity,%20dfs_capacity_used,%20dfs_capacity_used_non_hdfs%20where%20entityName=HDFS-1' |
1515 | 1526 |
|
1516 | 1527 | {
|
1517 | 1528 | "items" : [ {
|
1518 |
| - "name" : "dfs_capacity_used_non_hdfs", |
1519 |
| - "context" : "hdfs1:nameservice1", |
1520 |
| - "data" : [ { |
1521 |
| - "value" : 0.0, |
1522 |
| - "timestamp" : "2012-05-06T10:25:46.000Z" |
1523 |
| - }, { |
1524 |
| - "value" : 0.0, |
1525 |
| - "timestamp" : "2012-05-06T10:26:46.000Z" |
1526 |
| - }, { |
1527 |
| - "value" : 0.0, |
1528 |
| - "timestamp" : "2012-05-06T10:27:46.000Z" |
1529 |
| - }, { |
1530 |
| - "value" : 0.0, |
1531 |
| - "timestamp" : "2012-05-06T10:28:46.000Z" |
1532 |
| - }, { |
1533 |
| - "value" : 0.0, |
1534 |
| - "timestamp" : "2012-05-06T10:29:46.000Z" |
1535 |
| - } ], |
1536 |
| - "unit" : "bytes" |
1537 |
| - }, { |
1538 |
| - "name" : "dfs_capacity", |
1539 |
| - "context" : "hdfs1:nameservice1", |
1540 |
| - "data" : [ { |
1541 |
| - "value" : 3.2103841792E10, |
1542 |
| - "timestamp" : "2012-05-06T10:25:46.000Z" |
1543 |
| - }, { |
1544 |
| - "value" : 3.2103841792E10, |
1545 |
| - "timestamp" : "2012-05-06T10:26:46.000Z" |
1546 |
| - }, { |
1547 |
| - "value" : 3.2103841792E10, |
1548 |
| - "timestamp" : "2012-05-06T10:27:46.000Z" |
| 1529 | + "timeSeries": [ { |
| 1530 | + "metadata": { |
| 1531 | + "metricName": "dfs_capacity", |
| 1532 | + "entityName": "HDFS-1", |
| 1533 | + "startTime": "2015-09-17T23:42:22.533Z", |
| 1534 | + "endTime": "2015-09-17T23:47:22.533Z", |
| 1535 | + "attributes": { |
| 1536 | + "clusterName": "Cluster 1", |
| 1537 | + "category": "SERVICE", |
| 1538 | + "clusterDisplayName": "Cluster 1", |
| 1539 | + "active": "true", |
| 1540 | + "serviceType": "HDFS", |
| 1541 | + "serviceDisplayName": "HDFS-1", |
| 1542 | + "version": "CDH 5.7.0", |
| 1543 | + "serviceName": "HDFS-1", |
| 1544 | + "entityName": "HDFS-1" |
| 1545 | + }, |
| 1546 | + "unitNumerators": [ |
| 1547 | + "bytes" |
| 1548 | + ], |
| 1549 | + "unitDenominators": [], |
| 1550 | + "expression": "SELECT dfs_capacity WHERE entityName = \"HDFS-1\" AND category = SERVICE", |
| 1551 | + "metricCollectionFrequencyMs": 60000, |
| 1552 | + "rollupUsed": "RAW" |
| 1553 | + }, |
| 1554 | + "data": [ { |
| 1555 | + "timestamp": "2015-09-17T23:43:10.599Z", |
| 1556 | + "value": 86909397813, |
| 1557 | + "type": "SAMPLE" |
| 1558 | + }, { |
| 1559 | + "timestamp": "2015-09-17T23:44:10.605Z", |
| 1560 | + "value": 86909397813, |
| 1561 | + "type": "SAMPLE" |
| 1562 | + }, { |
| 1563 | + "timestamp": "2015-09-17T23:45:10.608Z", |
| 1564 | + "value": 86909397813, |
| 1565 | + "type": "SAMPLE" |
| 1566 | + }, { |
| 1567 | + "timestamp": "2015-09-17T23:46:10.615Z", |
| 1568 | + "value": 86909397813, |
| 1569 | + "type": "SAMPLE" |
| 1570 | + }, { |
| 1571 | + "timestamp": "2015-09-17T23:47:15.613Z", |
| 1572 | + "value": 86909397813, |
| 1573 | + "type": "SAMPLE" |
| 1574 | + } ] |
1549 | 1575 | }, {
|
1550 |
| - "value" : 3.2103841792E10, |
1551 |
| - "timestamp" : "2012-05-06T10:28:46.000Z" |
| 1576 | + "metadata": { |
| 1577 | + "metricName": "dfs_capacity_used", |
| 1578 | + "entityName": "HDFS-1", |
| 1579 | + "startTime": "2015-09-17T23:42:22.533Z", |
| 1580 | + "endTime": "2015-09-17T23:47:22.533Z", |
| 1581 | + "attributes": { |
| 1582 | + "clusterName": "Cluster 1", |
| 1583 | + "category": "SERVICE", |
| 1584 | + "clusterDisplayName": "Cluster 1", |
| 1585 | + "active": "true", |
| 1586 | + "serviceType": "HDFS", |
| 1587 | + "serviceDisplayName": "HDFS-1", |
| 1588 | + "version": "CDH 5.7.0", |
| 1589 | + "serviceName": "HDFS-1", |
| 1590 | + "entityName": "HDFS-1" |
| 1591 | + }, |
| 1592 | + "unitNumerators": [ |
| 1593 | + "bytes" |
| 1594 | + ], |
| 1595 | + "unitDenominators": [], |
| 1596 | + "expression": "SELECT dfs_capacity_used WHERE entityName = \"HDFS-1\" AND category = SERVICE", |
| 1597 | + "metricCollectionFrequencyMs": 60000, |
| 1598 | + "rollupUsed": "RAW" |
| 1599 | + }, |
| 1600 | + "data": [ { |
| 1601 | + "timestamp": "2015-09-17T23:43:10.599Z", |
| 1602 | + "value": 1728884736, |
| 1603 | + "type": "SAMPLE" |
| 1604 | + }, { |
| 1605 | + "timestamp": "2015-09-17T23:44:10.605Z", |
| 1606 | + "value": 1728884736, |
| 1607 | + "type": "SAMPLE" |
| 1608 | + }, { |
| 1609 | + "timestamp": "2015-09-17T23:45:10.608Z", |
| 1610 | + "value": 1728884736, |
| 1611 | + "type": "SAMPLE" |
| 1612 | + }, { |
| 1613 | + "timestamp": "2015-09-17T23:46:10.615Z", |
| 1614 | + "value": 1728884736, |
| 1615 | + "type": "SAMPLE" |
| 1616 | + }, { |
| 1617 | + "timestamp": "2015-09-17T23:47:15.613Z", |
| 1618 | + "value": 1728884736, |
| 1619 | + "type": "SAMPLE" |
| 1620 | + } ] |
1552 | 1621 | }, {
|
1553 |
| - "value" : 3.2103841792E10, |
1554 |
| - "timestamp" : "2012-05-06T10:29:46.000Z" |
| 1622 | + "metadata": { |
| 1623 | + "metricName": "dfs_capacity_used_non_hdfs", |
| 1624 | + "entityName": "HDFS-1", |
| 1625 | + "startTime": "2015-09-17T23:42:22.533Z", |
| 1626 | + "endTime": "2015-09-17T23:47:22.533Z", |
| 1627 | + "attributes": { |
| 1628 | + "clusterName": "Cluster 1", |
| 1629 | + "category": "SERVICE", |
| 1630 | + "clusterDisplayName": "Cluster 1", |
| 1631 | + "active": "true", |
| 1632 | + "serviceType": "HDFS", |
| 1633 | + "serviceDisplayName": "HDFS-1", |
| 1634 | + "version": "CDH 5.7.0", |
| 1635 | + "serviceName": "HDFS-1", |
| 1636 | + "entityName": "HDFS-1" |
| 1637 | + }, |
| 1638 | + "unitNumerators": [ |
| 1639 | + "bytes" |
| 1640 | + ], |
| 1641 | + "unitDenominators": [], |
| 1642 | + "expression": "SELECT dfs_capacity_used_non_hdfs WHERE entityName = \"HDFS-1\" AND category = SERVICE", |
| 1643 | + "metricCollectionFrequencyMs": 60000, |
| 1644 | + "rollupUsed": "RAW" |
| 1645 | + }, |
| 1646 | + "data": [ { |
| 1647 | + "timestamp": "2015-09-17T23:43:10.599Z", |
| 1648 | + "value": 1610609973, |
| 1649 | + "type": "SAMPLE" |
| 1650 | + }, { |
| 1651 | + "timestamp": "2015-09-17T23:44:10.605Z", |
| 1652 | + "value": 1610609973, |
| 1653 | + "type": "SAMPLE" |
| 1654 | + }, { |
| 1655 | + "timestamp": "2015-09-17T23:45:10.608Z", |
| 1656 | + "value": 1610609973, |
| 1657 | + "type": "SAMPLE" |
| 1658 | + }, { |
| 1659 | + "timestamp": "2015-09-17T23:46:10.615Z", |
| 1660 | + "value": 1610609973, |
| 1661 | + "type": "SAMPLE" |
| 1662 | + }, { |
| 1663 | + "timestamp": "2015-09-17T23:47:15.613Z", |
| 1664 | + "value": 1610609973, |
| 1665 | + "type": "SAMPLE" |
| 1666 | + } ] |
1555 | 1667 | } ],
|
1556 |
| - "unit" : "bytes" |
| 1668 | + "warnings": [], |
| 1669 | + "timeSeriesQuery": "select dfs_capacity, dfs_capacity_used, dfs_capacity_used_non_hdfs where entityName=HDFS-1" |
1557 | 1670 | } ]</code>
|
1558 | 1671 |
|
1559 | 1672 | [/@boilerplate]
|
|
0 commit comments