节点使用情况
1.0 版引入
节点使用情况端点返回关于节点上 REST 操作使用情况的底层信息。
端点
GET _nodes/usage
GET _nodes/<nodeId>/usage
GET _nodes/usage/<metric>
GET _nodes/<nodeId>/usage/<metric>
路径参数
您可以在请求中包含以下可选路径参数。
参数 | 类型 | 描述 |
---|---|---|
nodeId | 字符串 | 用于筛选结果的 nodeId 逗号分隔列表。支持节点过滤器。默认为 _all 。 |
度量 | 字符串 | 响应中将包含的指标。您可以将字符串设置为 _all 或 rest_actions 。rest_actions 返回某个操作在节点上被调用的总次数。_all 返回节点上的所有统计信息。默认为 _all 。 |
查询参数
您可以在请求中包含以下可选查询参数。
参数 | 类型 | 描述 |
---|---|---|
timeout | 时间 | 设置节点响应的时间限制。默认值为 30s 。 |
cluster_manager_timeout | 时间 | 设置集群管理器响应的时间限制。默认值为 30s 。 |
请求示例
以下请求返回所有节点的使用详情
GET _nodes/usage
示例响应
以下是示例响应。
{
"_nodes" : {
"total" : 1,
"successful" : 1,
"failed" : 0
},
"cluster_name" : "opensearch-cluster",
"nodes" : {
"t7uqHu4SSuWObK3ElkCRfw" : {
"timestamp" : 1665695174312,
"since" : 1663994849643,
"rest_actions" : {
"opendistro_get_rollup_action" : 3,
"nodes_usage_action" : 1,
"list_dangling_indices" : 1,
"get_index_template_action" : 258,
"nodes_info_action" : 152665,
"get_mapping_action" : 259,
"get_data_streams_action" : 12,
"cat_indices_action" : 6,
"get_indices_action" : 3,
"ism_explain_action" : 7,
"nodes_reload_action" : 1,
"get_policy_action" : 3,
"PerformanceAnalyzerClusterConfigAction" : 2,
"index_policy_action" : 1,
"rank_eval_action" : 3,
"search_action" : 592,
"get_aliases_action" : 258,
"document_mget_action" : 2,
"document_get_action" : 30,
"count_action" : 1,
"main_action" : 1
},
"aggregations" : { }
}
}
}
所需权限
如果您使用安全插件,请确保设置以下权限:cluster:manage/nodes
或 cluster:monitor/nodes
。