ElasticSearch之Task management API
命令样例如下:
curl -X GET "https://localhost:9200/_tasks?pretty" --cacert $ES_HOME/config/certs/http_ca.crt -u "elastic:ohCxPH=QBE+s5=*lo7F9"
执行结果的样例,如下:
{
"nodes" : {
"aKgBu7LgS9a6iPYH8n2JPw" : {
"name" : "jackie-ubuntu",
"transport_address" : "127.0.0.1:9300",
"host" : "127.0.0.1",
"ip" : "127.0.0.1:9300",
"roles" : [
"data",
"data_cold",
"data_content",
"data_frozen",
"data_hot",
"data_warm",
"ingest",
"master",
"ml",
"remote_cluster_client",
"transform"
],
"attributes" : {
"ml.allocated_processors" : "4",
"ml.allocated_processors_double" : "4.0",
"ml.max_jvm_size" : "2021654528",
"ml.config_version" : "11.0.0",
"xpack.installed" : "true",
"transform.config_version" : "10.0.0",
"ml.machine_memory" : "4040327168"
},
"tasks" : {
"aKgBu7LgS9a6iPYH8n2JPw:32" : {
"node" : "aKgBu7LgS9a6iPYH8n2JPw",
"id" : 32,
"type" : "persistent",
"action" : "health-node[c]",
"start_time_in_millis" : 1700843700401,
"running_time_in_nanos" : 514966368717794,
"cancellable" : true,
"cancelled" : false,
"parent_task_id" : "cluster:5",
"headers" : { }
},
"aKgBu7LgS9a6iPYH8n2JPw:33" : {
"node" : "aKgBu7LgS9a6iPYH8n2JPw",
"id" : 33,
"type" : "persistent",
"action" : "geoip-downloader[c]",
"start_time_in_millis" : 1700843700402,
"running_time_in_nanos" : 514966367872220,
"cancellable" : true,
"cancelled" : false,
"parent_task_id" : "cluster:6",
"headers" : { }
},
"aKgBu7LgS9a6iPYH8n2JPw:103625" : {
"node" : "aKgBu7LgS9a6iPYH8n2JPw",
"id" : 103625,
"type" : "direct",
"action" : "cluster:monitor/tasks/lists[n]",
"start_time_in_millis" : 1701358667224,
"running_time_in_nanos" : 22818915,
"cancellable" : true,
"cancelled" : false,
"parent_task_id" : "aKgBu7LgS9a6iPYH8n2JPw:103624",
"headers" : { }
},
"aKgBu7LgS9a6iPYH8n2JPw:103624" : {
"node" : "aKgBu7LgS9a6iPYH8n2JPw",
"id" : 103624,
"type" : "transport",
"action" : "cluster:monitor/tasks/lists",
"start_time_in_millis" : 1701358667171,
"running_time_in_nanos" : 76488858,
"cancellable" : true,
"cancelled" : false,
"headers" : { }
}
}
}
}
}
方法参数
detailed
,默认值为false
。
true
,包含详细信息。false
,包含必要的信息。
group_by
,默认值为nodes
。
可选值,包括:
nodes
,使用节点的标识排序。parents
,使用父任务的标识分组。none
,不对返回的结果进行分组。
nodes
,节点的标识,获取指定节点的信息。
parent_task_id
,父任务的标识,获取指定父任务下所有任务的信息。
相关资料
- Task management API