模糊匹配
GET /_tasks?detailed=true&actions=*reindex
例如,返回:节点信息(nodes) & 任务信息(tasks)
某个任务正在执行一个跨集群的 reindex 操作,数据从远程集群的 source_index 索引复制到本地集群的 destination_index 索引
json
"nodes": {
"tmKI6JpWRe2tEezmK_NCZA": { # 节点id
"name": "fdd16ed5d19a", # 节点名称
"transport_address": "172.18.0.2:9300", # 传输地址&通信端口
"host": "172.18.0.2",
"ip": "172.18.0.2:9300",
"roles": [ # 该节点角色,数据存储、数据处理、机器学习、远程客户端
"data",
"data_cold",
"data_content",
"data_frozen",
"data_hot",
"data_warm",
"ingest",
"master",
"ml",
"remote_cluster_client",
"transform"
],
"attributes": { # 机器学习相关属性
"ml.machine_memory": "6442450944",
"transform.config_version": "10.0.0",
"xpack.installed": "true",
"ml.config_version": "12.0.0",
"ml.max_jvm_size": "3221225472",
"ml.allocated_processors_double": "16.0",
"ml.allocated_processors": "16"
}
}
}
任务信息
json
"tasks": {
"tmKI6JpWRe2tEezmK_NCZA:13538917": { # 任务节点 & 任务ID
"node": "tmKI6JpWRe2tEezmK_NCZA",
"id": 13538917,
"type": "transport", # 任务类型,transport:跨节点任务
"action": "indices:data/write/reindex", # 操作类型为reindex
"status": {
"total": 59782375, # 需要处理的文档总量
"updated": 52110, # 已经更新的文档数量
"created": 5009000, # 已完成创建的文档数量
"deleted": 0,
"batches": 25839, # 已经处理的批次
"version_conflicts": 20776890, # 发生版本冲突的文档数量
"noops": 0,
"retries": {
"bulk": 0, # 没有发生重试
"search": 0 # 没有发生查询重试
},
"throttled_millis": 0, # 没有发生速率限制而被暂停
"requests_per_second": -1,
"throttled_until_millis": 0
},
"description": """reindex from [host=10.17.9.16 port=9200 query={
"match_all" : {
"boost" : 1.0
}
}][source_index] to [destination_index]""",
"start_time_in_millis": 1737616125515,
"running_time_in_nanos": 77797804793853,
"cancellable": true,
"cancelled": false,
"headers": {
"trace.id": "1be32ca32fc91148fb5b0332e715271d"
}
}
}
中途取消
POST /_tasks/tmKI6JpWRe2tEezmK_NCZA:13250244/_cancel
指定任务查看
GET /_tasks/tmKI6JpWRe2tEezmK_NCZA:13538917