0%

Ambari 监控相关接口

本文主要介绍一些常用的 Ambari 告警相关接口。

Ambari

登录

Request URL:

1
https://"managerHostIp":"port"/api/v1/users/"userName"?fields=privileges/PrivilegeInfo/permission_name

Request Method: GET

参数解析:

参数 类型 描述
managerHostIp String 管理节点主机 IP
port String 端口号,默认为8080
userName String 用户名称

返回格式:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
{
"Users" : {
"user_name" : "admin"
},
"privileges" : [
{
"PrivilegeInfo" : {
"permission_name" : "AMBARI.ADMINISTRATOR",
"privilege_id" : 1,
"user_name" : "admin"
}
}
]
}

示例:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
https://10.180.249.85:8080/api/v1/users/admin?fields=privileges/PrivilegeInfo/permission_name

Authorization:
Type:No Auth
Headers:
Host:<calculated when request is sent>
X-Requested-By:X-Requested-By
X-Requested-With:X-Requested-With
Authorization:Basic YWRtaW46bGMhQCM0NTY=


返回 Body:
{
"href" : "https://10.180.249.85:8080/api/v1/users/admin?fields=privileges/PrivilegeInfo/permission_name",
"Users" : {
"user_name" : "admin"
},
"privileges" : [
{
"href" : "https://10.180.249.85:8080/api/v1/users/admin/privileges/1",
"PrivilegeInfo" : {
"permission_name" : "AMBARI.ADMINISTRATOR",
"privilege_id" : 1,
"user_name" : "admin"
}
}
]
}

返回 Cookies:
AMBARISESSIONID:node05ynnze2uywiqmdesaq9nffh1772.node0

集群信息

Request URL:

1
https://"managerHostIp":"port"/api/v1/clusters?fields=Clusters/provisioning_state,Clusters/security_type,Clusters/version,Clusters/cluster_id

Request Method: GET

参数解析:

参数 类型 描述
managerHostIp String 管理节点主机 IP
port String 端口号,默认为8080

返回格式:

1
2
3
4
5
6
7
8
9
10
11
12
"items" : [
{
"href" : "https://10.180.249.85:8080/api/v1/clusters/cluster_85",
"Clusters" : {
"cluster_id" : 2,
"cluster_name" : "cluster_85",
"provisioning_state" : "INSTALLED",
"security_type" : "NONE",
"version" : "HDP-3.0"
}
}
]

返回字段说明:

名称 类型 描述
cluster_name String 集群名称
cluster_id int 集群 ID

示例:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
https://10.180.249.85:8080/api/v1/clusters?fields=Clusters/provisioning_state,Clusters/security_type,Clusters/version,Clusters/cluster_id

{
"href" : "https://10.180.249.85:8080/api/v1/clusters?fields=Clusters/provisioning_state,Clusters/security_type,Clusters/version,Clusters/cluster_id",
"items" : [
{
"href" : "https://10.180.249.85:8080/api/v1/clusters/cluster_85",
"Clusters" : {
"cluster_id" : 2,
"cluster_name" : "cluster_85",
"provisioning_state" : "INSTALLED",
"security_type" : "NONE",
"version" : "HDP-3.0"
}
}
]
}

查询主机列表

Request URL:

1
https://"managerHostIp":"port"/api/v1/clusters/"clusterName"/hosts?fields=Hosts/rack_info,Hosts/host_name,Hosts/maintenance_state,Hosts/public_host_name,Hosts/cpu_count,Hosts/ph_cpu_count,Hosts/host_status,Hosts/host_state,Hosts/last_heartbeat_time,Hosts/ip,Hosts/total_mem&minimal_response=true,host_components/logging&page_size=PageSize&from=fromIndex&sortBy=Hosts/host_name.asc

Request Method: GET

参数解析:

参数 类型 描述
managerHostIp String 管理节点主机 IP
port String 端口号,默认为8080
clusterName String 集群名称
PageSize int 每页个数
fromIndex int 开始的索引号

返回格式:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
{
"href" : "https://10.180.249.85:8080/api/v1/clusters/cluster_85/hosts?fields=Hosts/rack_info,Hosts/host_name,Hosts/maintenance_state,Hosts/public_host_name,Hosts/cpu_count,Hosts/ph_cpu_count,Hosts/host_status,Hosts/host_state,Hosts/last_heartbeat_time,Hosts/ip,Hosts/total_mem&minimal_response=true,host_components/logging&page_size=10&from=0&sortBy=Hosts/host_name.asc",
"itemTotal" : "3",
"items" : [
{
"href" : "https://10.180.249.85:8080/api/v1/clusters/cluster_85/hosts/manager.bigdata",
"Hosts" : {
"cluster_name" : "cluster_85",
"cpu_count" : 2,
"host_name" : "manager.bigdata",
"host_state" : "HEALTHY",
"host_status" : "UNHEALTHY",
"ip" : "10.180.249.85",
"last_heartbeat_time" : 1635129021560,
"maintenance_state" : "OFF",
"ph_cpu_count" : 2,
"public_host_name" : "manager.bigdata",
"rack_info" : "/default-rack",
"total_mem" : 16268368
}
},
{
"href" : "https://10.180.249.85:8080/api/v1/clusters/cluster_85/hosts/master.bigdata",
"Hosts" : {
"cluster_name" : "cluster_85",
"cpu_count" : 2,
"host_name" : "master.bigdata",
"host_state" : "HEALTHY",
"host_status" : "HEALTHY",
"ip" : "10.180.249.86",
"last_heartbeat_time" : 1635129018994,
"maintenance_state" : "OFF",
"ph_cpu_count" : 2,
"public_host_name" : "master.bigdata",
"rack_info" : "/default-rack",
"total_mem" : 16268368
}
},
{
"href" : "https://10.180.249.85:8080/api/v1/clusters/cluster_85/hosts/worker.bigdata",
"Hosts" : {
"cluster_name" : "cluster_85",
"cpu_count" : 2,
"host_name" : "worker.bigdata",
"host_state" : "HEALTHY",
"host_status" : "ALERT",
"ip" : "10.180.249.87",
"last_heartbeat_time" : 1635129022342,
"maintenance_state" : "OFF",
"ph_cpu_count" : 2,
"public_host_name" : "worker.bigdata",
"rack_info" : "/default-rack",
"total_mem" : 16268368
}
}
]
}

返回字段说明:

返回字段说明:

名称 类型 描述
host_name String 主机名称
ip String 主机 IP

示例:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
https://10.180.249.85:8080/api/v1/clusters/cluster_85/hosts?fields=Hosts/rack_info,Hosts/host_name,Hosts/maintenance_state,Hosts/public_host_name,Hosts/cpu_count,Hosts/ph_cpu_count,Hosts/host_status,Hosts/host_state,Hosts/last_heartbeat_time,Hosts/ip,Hosts/total_mem&minimal_response=true,host_components/logging&page_size=10&from=0&sortBy=Hosts/host_name.asc

{
"href" : "https://10.180.249.85:8080/api/v1/clusters/cluster_85/hosts?fields=Hosts/rack_info,Hosts/host_name,Hosts/maintenance_state,Hosts/public_host_name,Hosts/cpu_count,Hosts/ph_cpu_count,Hosts/host_status,Hosts/host_state,Hosts/last_heartbeat_time,Hosts/ip,Hosts/total_mem&minimal_response=true,host_components/logging&page_size=10&from=0&sortBy=Hosts/host_name.asc",
"itemTotal" : "3",
"items" : [
{
"href" : "https://10.180.249.85:8080/api/v1/clusters/cluster_85/hosts/manager.bigdata",
"Hosts" : {
"cluster_name" : "cluster_85",
"cpu_count" : 2,
"host_name" : "manager.bigdata",
"host_state" : "HEALTHY",
"host_status" : "UNHEALTHY",
"ip" : "10.180.249.85",
"last_heartbeat_time" : 1635129021560,
"maintenance_state" : "OFF",
"ph_cpu_count" : 2,
"public_host_name" : "manager.bigdata",
"rack_info" : "/default-rack",
"total_mem" : 16268368
}
},
{
"href" : "https://10.180.249.85:8080/api/v1/clusters/cluster_85/hosts/master.bigdata",
"Hosts" : {
"cluster_name" : "cluster_85",
"cpu_count" : 2,
"host_name" : "master.bigdata",
"host_state" : "HEALTHY",
"host_status" : "HEALTHY",
"ip" : "10.180.249.86",
"last_heartbeat_time" : 1635129018994,
"maintenance_state" : "OFF",
"ph_cpu_count" : 2,
"public_host_name" : "master.bigdata",
"rack_info" : "/default-rack",
"total_mem" : 16268368
}
},
{
"href" : "https://10.180.249.85:8080/api/v1/clusters/cluster_85/hosts/worker.bigdata",
"Hosts" : {
"cluster_name" : "cluster_85",
"cpu_count" : 2,
"host_name" : "worker.bigdata",
"host_state" : "HEALTHY",
"host_status" : "ALERT",
"ip" : "10.180.249.87",
"last_heartbeat_time" : 1635129022342,
"maintenance_state" : "OFF",
"ph_cpu_count" : 2,
"public_host_name" : "worker.bigdata",
"rack_info" : "/default-rack",
"total_mem" : 16268368
}
}
]
}

集群

查看各主机监控指标

Request URL:

1
https://"managerHostIp":"port"/api/v1/clusters/"clusterName"/hosts?fields=Hosts/rack_info,Hosts/host_name,Hosts/maintenance_state,Hosts/public_host_name,Hosts/cpu_count,Hosts/ph_cpu_count,Hosts/host_status,Hosts/host_state,Hosts/last_heartbeat_time,Hosts/ip,metrics/disk,metrics/load/load_one,Hosts/total_mem,Hosts/os_arch,Hosts/os_type,metrics/cpu/cpu_system,metrics/cpu/cpu_user,metrics/memory/mem_total,metrics/memory/mem_free,metrics/network&minimal_response=true&sortBy=Hosts/host_name.asc

Request Method: GET

参数解析:

参数 类型 描述
managerHostIp String 管理节点主机 IP
port String 端口号,默认为8080
clusterName String 集群名称

返回格式:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
{
"items" : [
{
"Hosts" : {
"cpu_count" : 2,
"host_name" : "manager.bigdata",
"host_state" : "HEALTHY",
"host_status" : "UNHEALTHY",
"ip" : "10.180.249.85",
"last_heartbeat_time" : 1635144518738,
"maintenance_state" : "OFF",
"os_arch" : "x86_64",
"os_type" : "centos7",
"ph_cpu_count" : 2,
"public_host_name" : "manager.bigdata",
"rack_info" : "/default-rack",
"total_mem" : 16268368
},
"metrics" : {
"cpu" : {
"cpu_system" : 2.1,
"cpu_user" : 7.2
},
"disk" : {
"disk_free" : 921.04,
"disk_total" : 1045.12,
"read_bytes" : 4.0172073472E10,
"read_count" : 1138709.0,
"read_time" : 6.4182694E7,
"write_bytes" : 3.98635586048E11,
"write_count" : 2.2530265E7,
"write_time" : 1.761842179E9
},
"load" : {
"load_one" : 0.44
},
"memory" : {
"mem_free" : 4674104.0,
"mem_total" : 1.6268368E7
},
"network" : {
"bytes_in" : 9653.420100811234,
"bytes_out" : 9870.084886235956,
"pkts_in" : 70.32365557353769,
"pkts_out" : 69.02506534277634
}
}
},
……
]
}

示例:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
https://10.180.249.85:8080/api/v1/clusters/cluster_85/hosts?fields=Hosts/rack_info,Hosts/host_name,Hosts/maintenance_state,Hosts/public_host_name,Hosts/cpu_count,Hosts/ph_cpu_count,Hosts/host_status,Hosts/host_state,Hosts/last_heartbeat_time,Hosts/ip,metrics/disk,metrics/load/load_one,Hosts/total_mem,Hosts/os_arch,Hosts/os_type,metrics/cpu/cpu_system,metrics/cpu/cpu_user,metrics/memory/mem_total,metrics/memory/mem_free,metrics/network&minimal_response=true&sortBy=Hosts/host_name.asc

{
"items" : [
{
"Hosts" : {
"cpu_count" : 2,
"host_name" : "manager.bigdata",
"host_state" : "HEALTHY",
"host_status" : "UNHEALTHY",
"ip" : "10.180.249.85",
"last_heartbeat_time" : 1635144518738,
"maintenance_state" : "OFF",
"os_arch" : "x86_64",
"os_type" : "centos7",
"ph_cpu_count" : 2,
"public_host_name" : "manager.bigdata",
"rack_info" : "/default-rack",
"total_mem" : 16268368
},
"metrics" : {
"cpu" : {
"cpu_system" : 2.1,
"cpu_user" : 7.2
},
"disk" : {
"disk_free" : 921.04,
"disk_total" : 1045.12,
"read_bytes" : 4.0172073472E10,
"read_count" : 1138709.0,
"read_time" : 6.4182694E7,
"write_bytes" : 3.98635586048E11,
"write_count" : 2.2530265E7,
"write_time" : 1.761842179E9
},
"load" : {
"load_one" : 0.44
},
"memory" : {
"mem_free" : 4674104.0,
"mem_total" : 1.6268368E7
},
"network" : {
"bytes_in" : 9653.420100811234,
"bytes_out" : 9870.084886235956,
"pkts_in" : 70.32365557353769,
"pkts_out" : 69.02506534277634
}
}
},
{
"Hosts" : {
"cpu_count" : 2,
"host_name" : "master.bigdata",
"host_state" : "HEALTHY",
"host_status" : "HEALTHY",
"ip" : "10.180.249.86",
"last_heartbeat_time" : 1635144516387,
"maintenance_state" : "OFF",
"os_arch" : "x86_64",
"os_type" : "centos7",
"ph_cpu_count" : 2,
"public_host_name" : "master.bigdata",
"rack_info" : "/default-rack",
"total_mem" : 16268368
},
"metrics" : {
"cpu" : {
"cpu_system" : 1.5,
"cpu_user" : 7.2
},
"disk" : {
"disk_free" : 991.98,
"disk_total" : 1007.5,
"read_bytes" : 3.63035904E9,
"read_count" : 40613.0,
"read_time" : 1203951.0,
"write_bytes" : 1.97316283904E11,
"write_count" : 1.3062845E7,
"write_time" : 3.22374479E8
},
"load" : {
"load_one" : 0.48
},
"memory" : {
"mem_free" : 5652008.0,
"mem_total" : 1.6268368E7
},
"network" : {
"bytes_in" : 9290.264862825667,
"bytes_out" : 10604.78914369175,
"pkts_in" : 80.59535755195986,
"pkts_out" : 76.49559370626463
}
}
},
{
"Hosts" : {
"cpu_count" : 2,
"host_name" : "worker.bigdata",
"host_state" : "HEALTHY",
"host_status" : "ALERT",
"ip" : "10.180.249.87",
"last_heartbeat_time" : 1635144521508,
"maintenance_state" : "OFF",
"os_arch" : "x86_64",
"os_type" : "centos7",
"ph_cpu_count" : 2,
"public_host_name" : "worker.bigdata",
"rack_info" : "/default-rack",
"total_mem" : 16268368
},
"metrics" : {
"cpu" : {
"cpu_system" : 1.8,
"cpu_user" : 10.6
},
"disk" : {
"disk_free" : 985.64,
"disk_total" : 1007.5,
"read_bytes" : 1.21029039616E11,
"read_count" : 6813225.0,
"read_time" : 1.8589039E8,
"write_bytes" : 3.75238186496E11,
"write_count" : 1.6113285E7,
"write_time" : 1.469239993E9
},
"load" : {
"load_one" : 0.51
},
"memory" : {
"mem_free" : 3197052.0,
"mem_total" : 1.6268368E7
},
"network" : {
"bytes_in" : 2814.9769795226225,
"bytes_out" : 2784.778299269138,
"pkts_in" : 22.199029855210195,
"pkts_out" : 19.699139105749587
}
}
}
]
}

集群 CPU 使用情况

Request URL:

1
https://"managerHostIp":"port"/api/v1/clusters/"clusterName"?fields=metrics/cpu/Nice._avg[stamp_start,timestamp_end,step],metrics/cpu/System._avg[stamp_start,timestamp_end,step],metrics/cpu/User._avg[stamp_start,timestamp_end,step],metrics/cpu/Idle._avg[stamp_start,timestamp_end,step]

Request Method: GET

参数解析:

参数 类型 描述
managerHostIp String 管理节点主机 IP
port String 端口号,默认为8080
clusterName String 集群名称
timestamp_start long 起始时间戳,单位:秒
timestamp_end long 起始时间戳,单位:秒
step int 间隔步长

返回格式:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
{
"Clusters" : {
"cluster_name" : "cluster_85"
},
"metrics" : {
"cpu" : {
"Idle._avg" : [
[
avg_cpu_idle_percent,
timestamp
],
[
avg_cpu_idle_percent,
timestamp
],
[
avg_cpu_idle_percent,
timestamp
],
……
],
"Nice._avg" : [
[
avg_cpu_nice_percent,
timestamp
],
[
avg_cpu_nice_percent,
timestamp
],
[
avg_cpu_nice_percent,
timestamp
],
[
avg_cpu_nice_percent,
timestamp
],
……
]
"System._avg" : [
[
avg_cpu_system_percent,
timestamp
],
[
avg_cpu_system_percent,
timestamp
],
[
avg_cpu_system_percent,
timestamp
],
……
],
"User._avg" : [
[
avg_cpu_user_percent,
timestamp
],
[
avg_cpu_user_percent,
timestamp
],
[
avg_cpu_user_percent,
timestamp
],
……
]
}
}
}

返回字段说明:

名称 类型 描述
avg_cpu_idle_percent double 平均 cpu_idle 百分比
avg_cpu_nice_percent double 平均 cpu_nice 百分比
avg_cpu_system_percent double 平均 cpu_system 百分比
avg_cpu_user_percent double 平均 cpu_user 百分比
timestamp long 时间戳,单位:秒

示例:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
https://10.180.249.85:8080/api/v1/clusters/cluster_85?fields=metrics/cpu/Nice._avg[1635492886,1635496486,15],metrics/cpu/System._avg[1635492886,1635496486,15],metrics/cpu/User._avg[1635492886,1635496486,15],metrics/cpu/Idle._avg[1635492886,1635496486,15]

{
"href" : "https://10.180.249.85:8080/api/v1/clusters/cluster_85?fields=metrics/cpu/Nice._avg[1635492886,1635496486,15],metrics/cpu/System._avg[1635492886,1635496486,15],metrics/cpu/User._avg[1635492886,1635496486,15],metrics/cpu/Idle._avg[1635492886,1635496486,15]",
"Clusters" : {
"cluster_name" : "cluster_85"
},
"metrics" : {
"cpu" : {
"Idle._avg" : [
[
0.0,
1635492886
],
[
12.433333333333332,
1635492900
],
[
12.433333333333332,
1635492930
],
……
],
"Nice._avg" : [
[
0.0,
1635492886
],
[
0.0,
1635492900
],
[
0.0,
1635492930
],
[
0.0,
1635492960
],
……
]
"System._avg" : [
[
0.0,
1635492886
],
[
2.8777777777777778,
1635492900
],
[
2.8777777777777778,
1635492930
],
……
],
"User._avg" : [
[
0.0,
1635492886
],
[
29.833333333333332,
1635492900
],
[
29.833333333333332,
1635492930
],
……
]
}
}
}

集群内存使用情况

Request URL:

1
https://"managerHostIp":"port"/api/v1/clusters/"clusterName"/?fields=metrics/memory/Buffer._avg[stamp_start,timestamp_end,step],metrics/memory/Cache._avg[stamp_start,timestamp_end,step],metrics/memory/Share._avg[stamp_start,timestamp_end,step],metrics/memory/Swap._avg[stamp_start,timestamp_end,step],metrics/memory/Total._avg[stamp_start,timestamp_end,step],metrics/memory/Use._avg[stamp_start,timestamp_end,step]

Request Method: GET

参数解析:

参数 类型 描述
managerHostIp String 管理节点主机 IP
port String 端口号,默认为8080
clusterName String 集群名称
timestamp_start long 起始时间戳,单位:秒
timestamp_end long 起始时间戳,单位:秒
step int 间隔步长

返回格式:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
{
"Clusters" : {
"cluster_name" : "cluster_85"
},
"metrics" : {
"memory" : {
"Buffer._avg" : [
[
avg_buffer_value,
timestamp
],
[
avg_buffer_value,
timestamp
],
[
avg_buffer_value,
timestamp
],
……
],
"Cache._avg" : [
[
avg_cache_value,
timestamp
],
[
avg_cache_value,
timestamp
],
[
avg_cache_value,
timestamp
],
……
],
"Share._avg" : [
[
avg_share_value,
timestamp
],
[
avg_share_value,
timestamp
],
[
avg_share_value,
timestamp
],
……
],
"Swap._avg" : [
[
avg_swap_value,
timestamp
],
[
avg_swap_value,
timestamp
],
[
avg_swap_value,
timestamp
],
……
],
"Total._avg" : [
[
avg_total_value,
timestamp
],
[
avg_total_value,
timestamp
],
[
avg_total_value,
timestamp
],
……
],
"Use._avg" : [
[
avg_use_value,
timestamp
],
[
avg_use_value,
timestamp
],
[
avg_use_value,
timestamp
],
……
]
}
}
}

返回字段说明:

名称 类型 描述
avg_buffer_value double 平均 buffer 值
avg_cache_value double 平均 cache 值
avg_swap_value double 平均 swap 值
avg_total_value double 平均 total 值
avg_use_value double 平均 use 值
timestamp long 时间戳,单位:秒

示例:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
https://10.180.249.85:8080/api/v1/clusters/cluster_85/?fields=metrics/memory/Buffer._avg[1635492886,1635496486,15],metrics/memory/Cache._avg[1635492886,1635496486,15],metrics/memory/Share._avg[1635492886,1635496486,15],metrics/memory/Swap._avg[1635492886,1635496486,15],metrics/memory/Total._avg[1635492886,1635496486,15],metrics/memory/Use._avg[1635492886,1635496486,15]

{
"href" : "https://10.180.249.85:8080/api/v1/clusters/cluster_85/?fields=metrics/memory/Buffer._avg[1635492886,1635496486,15],metrics/memory/Cache._avg[1635492886,1635496486,15],metrics/memory/Share._avg[1635492886,1635496486,15],metrics/memory/Swap._avg[1635492886,1635496486,15],metrics/memory/Total._avg[1635492886,1635496486,15],metrics/memory/Use._avg[1635492886,1635496486,15]",
"Clusters" : {
"cluster_name" : "cluster_85"
},
"metrics" : {
"memory" : {
"Buffer._avg" : [
[
0.0,
1635492886
],
[
81.33333333333333,
1635492900
],
[
81.33333333333333,
1635492930
],
……
],
"Cache._avg" : [
[
0.0,
1635492886
],
[
2255121.7777777775,
1635492900
],
[
2255121.7777777775,
1635492930
],
……
],
"Share._avg" : [
[
0.0,
1635492886
],
[
0.0,
1635492900
],
[
0.0,
1635492930
],
……
],
"Swap._avg" : [
[
0.0,
1635492886
],
[
1.4637808444444446E7,
1635492900
],
[
1.4637808444444446E7,
1635492930
],
……
],
"Total._avg" : [
[
0.0,
1635492886
],
[
1.6268368E7,
1635492900
],
[
1.6268368E7,
1635492930
],
……
],
"Use._avg" : [
[
0.0,
1635492886
],
[
1.3765412444444446E7,
1635492900
],
[
1.3765412444444446E7,
1635492930
],
……
]
}
}
}

集群网络使用情况

Request URL:

1
https://"managerHostIp":"port"/api/v1/clusters/"clusterName"/?fields=metrics/network/In._avg[stamp_start,timestamp_end,step],metrics/network/Out._avg[stamp_start,timestamp_end,step]

Request Method: GET

参数解析:

参数 类型 描述
managerHostIp String 管理节点主机 IP
port String 端口号,默认为8080
clusterName String 集群名称
timestamp_start long 起始时间戳,单位:秒
timestamp_end long 起始时间戳,单位:秒
step int 间隔步长

返回格式:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
{
"Clusters" : {
"cluster_name" : "cluster_85"
},
"metrics" : {
"network" : {
"In._avg" : [
[
avg_in_value,
timestamp
],
[
avg_in_value,
timestamp
],
[
avg_in_value,
timestamp
],
……
],
"Out._avg" : [
[
avg_out_value,
timestamp
],
[
avg_out_value,
timestamp
],
[
avg_out_value,
timestamp
],
……
]
}
}
}

返回字段说明:

名称 类型 描述
avg_in_value double 平均网络接收值
avg_out_value double 平均网络发送值
timestamp long 时间戳,单位:秒

示例:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
https://10.180.249.85:8080/api/v1/clusters/cluster_85/?fields=metrics/network/In._avg[1635492886,1635496486,15],metrics/network/Out._avg[1635492886,1635496486,15]

{
"href" : "https://10.180.249.85:8080/api/v1/clusters/cluster_85/?fields=metrics/network/In._avg[1635492886,1635496486,15],metrics/network/Out._avg[1635492886,1635496486,15]",
"Clusters" : {
"cluster_name" : "cluster_85"
},
"metrics" : {
"network" : {
"In._avg" : [
[
42216.83960870526,
1635493680
],
[
32214.112632067132,
1635493710
],
[
33326.8445137805,
1635493740
],
……
],
"Out._avg" : [
[
41526.13471217605,
1635493800
],
[
37271.59526417987,
1635493830
],
[
39065.415739918695,
1635493860
],
……
]
}
}
}

集群负载使用情况

Request URL:

1
https://"managerHostIp":"port"/api/v1/clusters/"clusterName"/?fields=metrics/load/1-min._avg[stamp_start,timestamp_end,step],metrics/load/CPUs._avg[stamp_start,timestamp_end,step],metrics/load/Nodes._avg[stamp_start,timestamp_end,step],metrics/load/Procs._avg[stamp_start,timestamp_end,step]

Request Method: GET

参数解析:

参数 类型 描述
managerHostIp String 管理节点主机 IP
port String 端口号,默认为8080
clusterName String 集群名称
timestamp_start long 起始时间戳,单位:秒
timestamp_end long 起始时间戳,单位:秒
step int 间隔步长

返回格式:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
{
"href" : "https://10.180.249.85:8080/api/v1/clusters/cluster_85/?fields=metrics/load/1-min._avg[1635492886,1635496486,15],metrics/load/CPUs._avg[1635492886,1635496486,15],metrics/load/Nodes._avg[1635492886,1635496486,15],metrics/load/Procs._avg[1635492886,1635496486,15]",
"Clusters" : {
"cluster_name" : "cluster_85"
},
"metrics" : {
"load" : {
"1-min._avg" : [
[
avg_1_min_value,
timestamp
],
[
avg_1_min_value,
timestamp
],
[
avg_1_min_value,
timestamp
],
……
],
"CPUs._avg" : [
[
avg_cpu_value,
timestamp
],
[
avg_cpu_value,
timestamp
],
[
avg_cpu_value,
timestamp
],
……
],
"Nodes._avg" : [
[
avg_node_value,
timestamp
],
[
avg_node_value,
timestamp
],
[
avg_node_value,
timestamp
],
……
],
"Procs._avg" : [
[
avg_procs_value,
timestamp
],
[
avg_procs_value,
timestamp
],
[
avg_procs_value,
timestamp
],
……
]
}
}
}

返回字段说明:

名称 类型 描述
avg_1_min_value double 1 分钟平均负载值
avg_cpu_value double 平均 CPU 数量
avg_node_value double 平均节点数
avg_procs_value double 平均进程数量
timestamp long 时间戳,单位:秒

示例:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
https://10.180.249.85:8080/api/v1/clusters/cluster_85/?fields=metrics/load/1-min._avg[1635492886,1635496486,15],metrics/load/CPUs._avg[1635492886,1635496486,15],metrics/load/Nodes._avg[1635492886,1635496486,15],metrics/load/Procs._avg[1635492886,1635496486,15]

{
"href" : "https://10.180.249.85:8080/api/v1/clusters/cluster_85/?fields=metrics/load/1-min._avg[1635492886,1635496486,15],metrics/load/CPUs._avg[1635492886,1635496486,15],metrics/load/Nodes._avg[1635492886,1635496486,15],metrics/load/Procs._avg[1635492886,1635496486,15]",
"Clusters" : {
"cluster_name" : "cluster_85"
},
"metrics" : {
"load" : {
"1-min._avg" : [
[
2.223333333333333,
1635492900
],
[
5.586666666666667,
1635493200
],
[
11.863333333333335,
1635493500
],
……
],
"CPUs._avg" : [
[
2.0,
1635492900
],
[
2.0,
1635493200
],
[
2.0,
1635493500
],
……
],
"Nodes._avg" : [
[
3.0,
1635492900
],
[
3.0,
1635493200
],
[
3.0,
1635493500
],
……
],
"Procs._avg" : [
[
1.7333333333333334,
1635492900
],
[
1.57,
1635493200
],
[
1.2,
1635493500
],
……
]
}
}
}

HDFS

HDFS 磁盘使用率

Request URL:

1
https://"managerHostIp":"port"/api/v1/clusters/"clusterName"/services/HDFS/components/NAMENODE?fields=metrics/dfs/namenode/Free,metrics/dfs/namenode/Used

Request Method: GET

参数解析:

参数 类型 描述
managerHostIp String 管理节点主机 IP
port String 端口号,默认为8080
clusterName String 集群名称

返回格式:

1
2
3
4
5
6
7
8
"metrics" : {
"dfs" : {
"namenode" : {
"Free" : 941056749412,
"Used" : 3869090052
}
}
}

返回字段说明:

名称 类型 描述
Free int DFS 空闲空间,单位:比特
Used int DFS 已使用空间,单位:比特

示例:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
https://10.180.249.85:8080/api/v1/clusters/cluster_85/services/HDFS/components/NAMENODE?fields=metrics/dfs/namenode/Free,metrics/dfs/namenode/Used

{
"href" : "https://10.180.249.85:8080/api/v1/clusters/cluster_85/services/HDFS/components/NAMENODE?fields=metrics/dfs/namenode/Free,metrics/dfs/namenode/Used",
"ServiceComponentInfo" : {
"cluster_name" : "cluster_85",
"component_name" : "NAMENODE",
"service_name" : "HDFS"
},
"metrics" : {
"dfs" : {
"namenode" : {
"Free" : 941056749412,
"Used" : 3869090052
}
}
}
}

HDFS CPU、内存使用率

Request URL:

1
https://"managerHostIp":"port"/api/v1/clusters/"clusterName"/host_components?HostRoles/component_name=NAMENODE&metrics/dfs/FSNamesystem/HAState=active&fields=metrics/cpu/cpu_system[timestamp_start,timestamp_end,step],metrics/cpu/cpu_user[timestamp_start,timestamp_end,step],metrics/cpu/cpu_nice[timestamp_start,timestamp_end,step],metrics/cpu/cpu_idle[timestamp_start,timestamp_end,step],metrics/cpu/cpu_wio[timestamp_start,timestamp_end,step],metrics/memory/mem_total[timestamp_start,timestamp_end,step],metrics/memory/mem_free[timestamp_start,timestamp_end,step]

Request Method: GET

参数解析:

参数 类型 描述
managerHostIp String 管理节点主机 IP
port String 端口号,默认为8080
clusterName String 集群名称
timestamp_start long 起始时间戳,单位:秒
timestamp_end long 起始时间戳,单位:秒
step int 间隔步长

返回格式:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
"metrics" : {
"cpu" : {
"cpu_idle" : [
[
cpu_idle_percent,
timestamp
],
[
cpu_idle_percent,
timestamp
],
[
cpu_idle_percent,
timestamp
],

……
],
"cpu_nice" : [
[
cpu_nice_percent,
timestamp
],
[
cpu_nice_percent,
timestamp
],
[
cpu_nice_percent,
timestamp
]
……
],
"cpu_user" : [
[
cpu_user_percent,
timestamp
],
[
cpu_user_percent,
timestamp
],
[
cpu_user_percent,
timestamp
],
……
],
"cpu_wio" : [
[
cpu_wio_percent,
timestamp
],
[
cpu_wio_percent,
timestamp
],
[
cpu_wio_percent,
timestamp
],
……
]
},
"memory" : {
"mem_free" : [
[
mem_free_value,
timestamp
],
[
mem_free_value,
timestamp
],
[
mem_free_value,
timestamp
],
……
],
"mem_total" : [
[
mem_total_value,
timestamp
],
[
mem_total_value,
timestamp
],
[
mem_total_value,
timestamp
],
……
]
}

返回字段说明:

名称 类型 描述
cpu_idle_percent double cpu_idle 百分比
cpu_nice_percent double cpu_nice 百分比
cpu_wio_percent double cpu_wio 百分比
mem_free_value double mem_free 值,单位:bit
mem_total_value double mem_total 值,单位:bit
timestamp long 时间戳,单位:秒

示例:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
https://10.180.249.85:8080/api/v1/clusters/cluster_85/host_components?HostRoles/component_name=NAMENODE&metrics/dfs/FSNamesystem/HAState=active&fields=metrics/cpu/cpu_system[1634713377,1634716977,15],metrics/cpu/cpu_user[1634713377,1634716977,15],metrics/cpu/cpu_nice[1634713377,1634716977,15],metrics/cpu/cpu_idle[1634713377,1634716977,15],metrics/cpu/cpu_wio[1634713377,1634716977,15],metrics/memory/mem_total[1634713377,1634716977,15],metrics/memory/mem_free[1634713377,1634716977,15]

{
"href" : "https://10.180.249.85:8080/api/v1/clusters/cluster_85/host_components?HostRoles/component_name=NAMENODE&metrics/dfs/FSNamesystem/HAState=active&fields=metrics/cpu/cpu_system[1634713377,1634716977,15],metrics/cpu/cpu_user[1634713377,1634716977,15],metrics/cpu/cpu_nice[1634713377,1634716977,15],metrics/cpu/cpu_idle[1634713377,1634716977,15],metrics/cpu/cpu_wio[1634713377,1634716977,15],metrics/memory/mem_total[1634713377,1634716977,15],metrics/memory/mem_free[1634713377,1634716977,15]",
"items" : [
{
"href" : "https://10.180.249.85:8080/api/v1/clusters/cluster_85/hosts/manager.bigdata/host_components/NAMENODE",
"HostRoles" : {
"cluster_name" : "cluster_85",
"component_name" : "NAMENODE",
"host_name" : "manager.bigdata"
},
"host" : {
"href" : "https://10.180.249.85:8080/api/v1/clusters/cluster_85/hosts/manager.bigdata"
},
"metrics" : {
"cpu" : {
"cpu_idle" : [
[
0.0,
1634713377
],
[
85.5,
1634713386
],
[
68.2,
1634713396
],

……
],
"cpu_nice" : [
[
2.2,
1634716948
],
[
1.2,
1634716958
],
[
7.5,
1634716968
]
……
],
"cpu_user" : [
[
0.0,
1634713377
],
[
11.5,
1634713386
],
[
26.0,
1634713396
],
……
],
"cpu_wio" : [
[
0.0,
1634713377
],
[
0.2,
1634713386
],
[
0.1,
1634713396
],
……
]
},
"dfs" : {
"FSNamesystem" : {
"HAState" : "active"
}
},
"memory" : {
"mem_free" : [
[
0.0,
1634713377
],
[
3456052.0,
1634713386
],
[
3458428.0,
1634713396
],
……
],
"mem_total" : [
[
0.0,
1634713377
],
[
1.6268368E7,
1634713386
],
[
1.6268368E7,
1634713396
],
……
]
}
}
}
]
}

HBase

HBase CPU、网络使用率

Request URL:

1
https://"managerHostIp":"port"/api/v1/clusters/"clusterName"/services/HBASE/components/HBASE_REGIONSERVER?fields=metrics/hbase/regionserver/Server/Get_num_ops._rate[stamp_start,timestamp_end,step],metrics/hbase/regionserver/Server/ScanSize_num_ops._rate[stamp_start,timestamp_end,step],metrics/cpu/cpu_system._avg[stamp_start,timestamp_end,step],metrics/cpu/cpu_user._avg[stamp_start,timestamp_end,step],metrics/cpu/cpu_nice._avg[stamp_start,timestamp_end,step],metrics/cpu/cpu_idle._avg[stamp_start,timestamp_end,step],metrics/cpu/cpu_wio._avg[stamp_start,timestamp_end,step],metrics/network/pkts_in._avg[stamp_start,timestamp_end,step],metrics/network/pkts_out._avg[stamp_start,timestamp_end,step],metrics/disk/read_bps._sum[stamp_start,timestamp_end,step],metrics/disk/write_bps._sum[stamp_start,timestamp_end,step]

Request Method: GET

参数解析:

参数 类型 描述
managerHostIp String 管理节点主机 IP
port String 端口号,默认为8080
clusterName String 集群名称
timestamp_start long 起始时间戳,单位:秒
timestamp_end long 起始时间戳,单位:秒
step int 间隔步长

返回格式:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
"metrics" : {
"cpu" : {
"cpu_idle._avg" : [
[
avg_cpu_idle_percent,
timestamp
],
[
avg_cpu_idle_percent,
timestamp
],
[
avg_cpu_idle_percent,
timestamp
],
……
],
"cpu_system._avg" : [
[
avg_cpu_system_percent,
timestamp
],
[
avg_cpu_system_percent,
timestamp
],
……
],
"cpu_user._avg" : [
[
avg_cpu_user_percent,
timestamp
],
[
avg_cpu_user_percent,
timestamp
],
[
avg_cpu_user_percent,
timestamp
],
……
],
"cpu_wio._avg" : [
[
avg_cpu_wio_percent,
timestamp
],
[
avg_cpu_wio_percent,
timestamp
],
[
avg_cpu_wio_percent,
timestamp
],
……
]
},
"network" : {
"pkts_in._avg" : [
[
avg_pkts_in_value,
timestamp
],
[
avg_pkts_in_value,
timestamp
],
[
avg_pkts_in_value,
timestamp
],
……
],
"pkts_out._avg" : [
[
avg_pkts_in_value,
timestamp
],
[
avg_pkts_in_value,
timestamp
],
[
avg_pkts_in_value,
timestamp
],
……
]
}

返回字段说明:

名称 类型 描述
avg_cpu_idle_percent double 平均 cpu_idle 百分比
avg_cpu_system_percent double 平均 cpu_system 百分比
avg_cpu_user_percent double 平均 cpu_user 百分比
avg_cpu_wio_percent double 平均 cpu_wio 百分比
avg_pkts_in_value double mem_free 值,单位:bit
avg_pkts_in_value double mem_total 值,单位:bit
timestamp long 时间戳,单位:秒

示例:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
https://10.180.249.85:8080/api/v1/clusters/cluster_85/services/HBASE/components/HBASE_REGIONSERVER?fields=metrics/hbase/regionserver/Server/Get_num_ops._rate[1634716159,1634719759,15],metrics/hbase/regionserver/Server/ScanSize_num_ops._rate[1634716159,1634719759,15],metrics/cpu/cpu_system._avg[1634716159,1634719759,15],metrics/cpu/cpu_user._avg[1634716159,1634719759,15],metrics/cpu/cpu_nice._avg[1634716159,1634719759,15],metrics/cpu/cpu_idle._avg[1634716159,1634719759,15],metrics/cpu/cpu_wio._avg[1634716159,1634719759,15],metrics/network/pkts_in._avg[1634716159,1634719759,15],metrics/network/pkts_out._avg[1634716159,1634719759,15],metrics/disk/read_bps._sum[1634716159,1634719759,15],metrics/disk/write_bps._sum[1634716159,1634719759,15]

{
"href" : "https://10.180.249.85:8080/api/v1/clusters/cluster_85/services/HBASE/components/HBASE_REGIONSERVER?fields=metrics/hbase/regionserver/Server/Get_num_ops._rate[1634716159,1634719759,15],metrics/hbase/regionserver/Server/ScanSize_num_ops._rate[1634716159,1634719759,15],metrics/cpu/cpu_system._avg[1634716159,1634719759,15],metrics/cpu/cpu_user._avg[1634716159,1634719759,15],metrics/cpu/cpu_nice._avg[1634716159,1634719759,15],metrics/cpu/cpu_idle._avg[1634716159,1634719759,15],metrics/cpu/cpu_wio._avg[1634716159,1634719759,15],metrics/network/pkts_in._avg[1634716159,1634719759,15],metrics/network/pkts_out._avg[1634716159,1634719759,15],metrics/disk/read_bps._sum[1634716159,1634719759,15],metrics/disk/write_bps._sum[1634716159,1634719759,15]",
"ServiceComponentInfo" : {
"cluster_name" : "cluster_85",
"component_name" : "HBASE_REGIONSERVER",
"service_name" : "HBASE"
},
"metrics" : {
"cpu" : {
"cpu_idle._avg" : [
[
80.61666666666667,
1634716170
],
[
76.35,
1634716200
],
[
80.55,
1634716230
],
……
],
"cpu_system._avg" : [
[
3.3666666666666667,
1634716170
],
[
3.4833333333333334,
1634716200
],
……
],
"cpu_user._avg" : [
[
15.816666666666666,
1634716170
],
[
19.916666666666668,
1634716200
],
[
15.8,
1634716230
],
……
],
"cpu_wio._avg" : [
[
0.18333333333333335,
1634716170
],
[
0.13333333333333333,
1634716200
],
[
0.20833333333333334,
1634716230
],
……
]
},
"disk" : {
"read_bps._sum" : [
[
817.8653225961747,
1634716170
],
[
3275.9546133765416,
1634716230
],
[
3271.6184408805548,
1634716260
],
……
],
"write_bps._sum" : [
[
648362.5362561946,
1634716170
],
[
283359.98861003027,
1634716200
],
[
897984.5417469091,
1634716230
],
……
]
},
"network" : {
"pkts_in._avg" : [
[
36.871528602614,
1634716170
],
[
41.99892128602031,
1634716200
],
[
49.99695693170576,
1634716230
],
……
],
"pkts_out._avg" : [
[
29.373641001955054,
1634716170
],
[
33.62299985023638,
1634716200
],
[
42.00411973306949,
1634716230
],
……
]
}
}
}

Kafka

Kafka 输入输出流量

Request URL:

1
http://"kafkaWebUIIp":"port"/ke/metrics/brokers/mbean/ajax

Request Method: GET

参数解析:

参数 类型 描述
kafkaWebUIIp String Kafka webUI IP
port String 端口号,默认为:10095

返回格式:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
{
"ins": {
"fifteenMinute": "fifteen_minute_value",
"fiveMinute": "five_minute_value",
"meanRate": "mean_rate_value",
"oneMinute": "one_minute_value"
},
"out": {
"fifteenMinute": "fifteen_minute_value",
"fiveMinute": "five_minute_value",
"meanRate": "mean_rate_value",
"oneMinute": "one_minute_value"
}
}

返回字段说明:

名称 类型 描述
fifteen_minute_value double 15 分钟值,单位:B
five_minute_value double 5 分钟值,单位:B
mean_rate_value double 平均值,单位:B
one_minute_value double 1分钟值,单位:B

示例:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
http://10.180.249.85:10095/ke/metrics/brokers/mbean/ajax

{
"ins": {
"fifteenMinute": "135B",
"fiveMinute": "107B",
"meanRate": "98B",
"oneMinute": "129B"
},
"out": {
"fifteenMinute": "147B",
"fiveMinute": "128B",
"meanRate": "97B",
"oneMinute": "125B"
}
}

Spark

Spark 分配内存

Request URL:

1
https://"managerHostIp":"port"/api/v1/clusters/"clusterName"/configurations/service_config_versions?service_name=SPARK2&is_current=true

Request Method: GET

参数解析:

参数 类型 描述
managerHostIp String 管理节点主机 IP
port String 端口号,默认为8080
clusterName String 集群名称

返回格式:

1
2
3
4
5
6
7
8
9
10
11
12
{
"properties": {
"hive_kerberos_keytab": "{{hive_kerberos_keytab}}",
"hive_kerberos_principal": "{{hive_kerberos_principal}}",
"spark_daemon_memory": "2048",
"spark_group": "spark",
"spark_log_dir": "/var/log/spark2",
"spark_pid_dir": "/var/run/spark2",
"spark_thrift_cmd_opts": "",
"spark_user": "spark"
},
},

返回字段说明:

名称 类型 描述
spark_daemon_memory string Spark 分配内存,单位:MB

示例:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
https://10.180.249.85:8080/api/v1/clusters/cluster_85/configurations/service_config_versions?service_name=SPARK2&is_current=true


{
"href": "https://10.180.249.85:8080/api/v1/clusters/cluster_85/configurations/service_config_versions?service_name=SPARK2&is_current=true",
"items": [
{
"href": "https://10.180.249.85:8080/api/v1/clusters/cluster_85/configurations/service_config_versions?service_name=SPARK2&service_config_version=2",
"cluster_name": "cluster_85",
"configurations": [
{
"Config": {
"cluster_name": "cluster_85",
"stack_id": "HDP-3.0"
},
"type": "livy2-client-conf",
"tag": "1c82b935-1a1f-49bb-ac7d-923e8680a988",
"version": 1,
"properties": {
"livy.rsc.launcher.address": " "
},
"properties_attributes": {}
},
……
{
"properties": {
"hive_kerberos_keytab": "{{hive_kerberos_keytab}}",
"hive_kerberos_principal": "{{hive_kerberos_principal}}",
"spark_daemon_memory": "2048",
"spark_group": "spark",
"spark_log_dir": "/var/log/spark2",
"spark_pid_dir": "/var/run/spark2",
"spark_thrift_cmd_opts": "",
"spark_user": "spark"
},
},

],
"createtime": 1615374599431,
"group_id": -1,
"group_name": "Default",
"is_cluster_compatible": true,
"is_current": true,
"service_config_version": 2,
"service_name": "SPARK2",
"stack_id": "HDP-3.0",
"user": "admin"
}
]
}

ElasticSearch

ES CPU、内存使用率

Request URL:

1
http://"elasticSearchMasterIp":"port"/_cat/nodes?v&pretty

Request Method: GET

参数解析:

参数 类型 描述
elasticSearchMasterIp String ElasticSearch 管理节点主机 IP
port String 端口号,默认为:9200

返回格式:

1
2
3
4
5
6
7
ip            heap.percent ram.percent cpu load_1m load_5m load_15m node.role master name
10.180.249.86 14 96 20 0.50 0.42 0.41 im * master.bigdata-master
10.180.249.87 7 98 50 4.09 1.83 1.22 di - worker.bigdata-slave
10.180.249.85 9 99 17 0.93 1.20 1.06 im - manager.bigdata-master
10.180.249.87 8 98 50 4.09 1.83 1.22 im - worker.bigdata-master
10.180.249.85 7 99 17 0.93 1.20 1.06 di - manager.bigdata-slave
10.180.249.86 9 96 20 0.50 0.42 0.41 di - master.bigdata-slave

返回字段说明:

名称 类型 描述
cpu int CPU 使用百分比

示例:

1
2
3
4
5
6
7
8
[root@manager ~]# curl -XGET -K -u 'admin':'pwd' 'http://10.180.249.85:9200/_cat/nodes?v&pretty'
ip heap.percent ram.percent cpu load_1m load_5m load_15m node.role master name
10.180.249.86 14 96 20 0.50 0.42 0.41 im * master.bigdata-master
10.180.249.87 7 98 50 4.09 1.83 1.22 di - worker.bigdata-slave
10.180.249.85 9 99 17 0.93 1.20 1.06 im - manager.bigdata-master
10.180.249.87 8 98 50 4.09 1.83 1.22 im - worker.bigdata-master
10.180.249.85 7 99 17 0.93 1.20 1.06 di - manager.bigdata-slave
10.180.249.86 9 96 20 0.50 0.42 0.41 di - master.bigdata-slave

ES 磁盘使用率

Request URL:

1
http://"elasticSearchMasterIp":"port"/_cat/allocation?v&pretty

Request Method: GET

参数解析:

参数 类型 描述
elasticSearchMasterIp String ElasticSearch 管理节点主机 IP
port String 端口号,默认为:9200

返回格式:

1
2
3
4
shards disk.indices disk.used disk.avail disk.total disk.percent host          ip            node
0 0b 21.6gb 985.3gb 1007gb 2 10.180.249.87 10.180.249.87 worker.bigdata-slave
0 0b 84.9gb 922gb 1007gb 8 10.180.249.85 10.180.249.85 manager.bigdata-slave
0 0b 15.2gb 991.7gb 1007gb 1 10.180.249.86 10.180.249.86 master.bigdata-slave

返回字段说明:

名称 类型 描述
disk.avail string 磁盘可使用空间

示例:

1
2
3
4
5
[root@manager ~]# curl -XGET -K -u 'admin':'pwd' 'http://10.180.249.85:9200/_cat/allocation?v&pretty'
shards disk.indices disk.used disk.avail disk.total disk.percent host ip node
0 0b 21.6gb 985.3gb 1007gb 2 10.180.249.87 10.180.249.87 worker.bigdata-slave
0 0b 84.9gb 922gb 1007gb 8 10.180.249.85 10.180.249.85 manager.bigdata-slave
0 0b 15.2gb 991.7gb 1007gb 1 10.180.249.86 10.180.249.86 master.bigdata-slave

ES 文档总条数

Request URL:

1
http://"elasticSearchMasterIp":"port"/_cat/count?v&pretty

Request Method: GET

参数解析:

参数 类型 描述
elasticSearchMasterIp String ElasticSearch 管理节点主机 IP
port String 端口号,默认为:9200

返回格式:

1
2
epoch      timestamp count
1634781017 01:50:17 11

返回字段说明:

名称 类型 描述
count int 文档条数

示例:

1
2
3
[root@manager ~]# curl -XGET -K -u 'admin':'pwd' 'http://10.180.249.85:9200/_cat/count?v&pretty'
epoch timestamp count
1634781017 01:50:17 10

ES 查看文档容量

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
curl -XGET -K -u 'admin':'pwd' 'http://10.180.249.85:9200/_stats?&pretty'

{
"_shards": {
"total": 15,
"successful": 15,
"failed": 0
},
"_all": {
"primaries": {
"docs": {
"count": 11,
"deleted": 1
},
"store": {
"size_in_bytes": 72930
},

……

},
……
},
……
}