Elasticsearch 集群状态详解

cluster state 返回结果详解

复制代码
GET /_cluster/state

https://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-state.html

详细信息如下:

复制代码
{
	"cluster_name": "business-log",
	"cluster_uuid": "ArYy-qmCTbCQTDUI8ogsBg",
	"version": 497261,
	"state_uuid": "6_u2t1A1Rnyw70hfp7eWIQ",
	"master_node": "1WRaRyU-SuCPn8qbz3e4hg",
	"blocks": {
		"indices": {
			".kibana_1": {
				"8": {
					"description": "index write (api)",
					"retryable": false,
					"levels": [
						"write"
					]
				}
			}
		}
	},
	"nodes": {
		"hYrrmhLHTx-QHoDmZ2wATg": {
			"__jiankunking_comment__": "节点名称、监听地址和端口等信息",
			"name": "es-b-220",
			"ephemeral_id": "Pk0I_YgZQKe0bK1EIQ8R-w",
			"transport_address": "127.0.220.220:9301",
			"attributes": {
				"ml.machine_memory": "135202910208",
				"ml.max_open_jobs": "512",
				"xpack.installed": "true",
				"ml.max_jvm_size": "33285996544",
				"transform.node": "true"
			},
			"roles": [
				"data",
				"data_cold",
				"data_content",
				"data_frozen",
				"data_hot",
				"data_warm",
				"ingest",
				"master",
				"ml",
				"remote_cluster_client",
				"transform"
			]
		}
	},
	"metadata": {
		"__metadata_jiankunking_comment__": "集群元数据",
		"cluster_uuid": "ArYy-qmCTbCQTDUI8ogsBg",
		"cluster_uuid_committed": true,
		"__cluster_uuid_committed_comment__": "Whether the current node with the given cluster state is locked into the cluster with the UUID returned by {@link #clusterUUID()}, meaning that it will not accept any cluster state with a different clusterUUID. https://github.com/jiankunking/elasticsearch/blob/692cca611db5db3365cba45320879f4e05d3d7d2/server/src/main/java/org/elasticsearch/cluster/metadata/Metadata.java#L241",
		"cluster_coordination": {
			"term": 92,
			"__last_committed_config_comment__": "https://www.elastic.co/guide/en/elasticsearch/reference/7.13/modules-discovery-voting.html"
			"last_committed_config": [
				"hYrrmhLHTx-QHoDmZ2wATg",
				"jaNLhd1eT6SUYcLJkHpE1Q",
				"1VQFmt9jQ-6d7fCMjP-vnQ",
				"uzGdH3VeRbOlcDIWeKdgIw",
				"PhjlCea6TNKh4rdZPyPDkA",
				"ZFQdNP4HSgCtPCnMfDdopw",
				"1WRaRyU-SuCPn8qbz3e4hg"
			],
			"last_accepted_config": [
				"hYrrmhLHTx-QHoDmZ2wATg",
				"jaNLhd1eT6SUYcLJkHpE1Q",
				"1VQFmt9jQ-6d7fCMjP-vnQ",
				"uzGdH3VeRbOlcDIWeKdgIw",
				"PhjlCea6TNKh4rdZPyPDkA",
				"ZFQdNP4HSgCtPCnMfDdopw",
				"1WRaRyU-SuCPn8qbz3e4hg"
			],
			"voting_config_exclusions": []
		},
		"templates": {
			"__templates_jiankunking_comment__": "全部模板的具体内容",
			"k8s-log-template": {
				"order": 0,
				"index_patterns": [
					"logstash-*"
				],
				"settings": {
					"index": {
						"codec": "best_compression",
						"refresh_interval": "30s",
						"number_of_shards": "3",
						"number_of_replicas": "1"
					}
				},
				"mappings": {
					"_doc": {
						"dynamic_templates": [
							{
								"strings_as_keywords": {
									"unmatch": "log",
									"mapping": {
										"type": "keyword"
									},
									"match_mapping_type": "string"
								}
							},
							{
								"log": {
									"mapping": {
										"norms": false,
										"analyzer": "standard",
										"type": "text"
									},
									"match_mapping_type": "string",
									"match": "log"
								}
							},
							{
								"@timestamp": {
									"mapping": {
										"type": "date"
									},
									"match_mapping_type": "date",
									"match": "@timestamp"
								}
							}
						]
					}
				},
				"aliases": {}
			}
		},
		"indices": {
			"__indices_jiankunking_comment__": "索引列表",
			"logstash-2023.11.06": {
				"version": 27,
				"mapping_version": 20,
				"settings_version": 1,
				"aliases_version": 1,
				"routing_num_shards": 896,
				"state": "open",
				"settings": {
					"index": {
						"codec": "best_compression",
						"routing": {
							"allocation": {
								"include": {
									"_tier_preference": "data_content"
								}
							}
						},
						"refresh_interval": "30s",
						"number_of_shards": "7",
						"provided_name": "logstash-2023.11.06",
						"creation_date": "1699200016628",
						"number_of_replicas": "1",
						"uuid": "eplKvvIaSpaTzwqhjwGNYQ",
						"version": {
							"created": "7130499"
						}
					}
				},
				"mappings": {
					"_doc": {
						"dynamic_templates": [
							{
								"strings_as_keywords": {
									"unmatch": "log",
									"mapping": {
										"type": "keyword"
									},
									"match_mapping_type": "string"
								}
							},
							{
								"log": {
									"mapping": {
										"norms": false,
										"analyzer": "standard",
										"type": "text"
									},
									"match_mapping_type": "string",
									"match": "log"
								}
							},
							{
								"@timestamp": {
									"mapping": {
										"type": "date"
									},
									"match_mapping_type": "date",
									"match": "@timestamp"
								}
							}
						],
						"properties": {
							"cluster": {
								"type": "keyword"
							},
							"kubernetes": {
								"properties": {
									"container_name": {
										"type": "keyword"
									},
									"statefulset": {
										"properties": {
											"name": {
												"type": "keyword"
											}
										}
									},
									"annotations": {
										"properties": {
											"helm_sh/namespace": {
												"type": "keyword"
											},
											"helm_sh/release": {
												"type": "keyword"
											}
										}
									},
									"namespace_uid": {
										"type": "keyword"
									},
									"namespace_labels": {
										"properties": {
											"kubernetes_io/metadata_name": {
												"type": "keyword"
											},
											"control-plane": {
												"type": "keyword"
											}
										}
									},
									"namespace_name": {
										"type": "keyword"
									},
									"pod_name": {
										"type": "keyword"
									}
								}
							},
							"log": {
								"norms": false,
								"analyzer": "standard",
								"type": "text"
							},
							"node_name": {
								"type": "keyword"
							},
							"@timestamp": {
								"type": "date"
							}
						}
					}
				},
				"aliases": [],
				"primary_terms": {
					"__primary_terms_jiankunking_comment__": "某个分片被选为主分片的次数,用于区分新旧主分片;https://www.devopsschool.com/blog/what-is-seq_no-and-primary_term-in-elasticsearch/",
					"0": 1,
					"1": 2,
					"2": 4,
					"3": 3,
					"4": 1,
					"5": 7,
					"6": 4
				},
				"in_sync_allocations": {
					"__in_sync_allocations_jiankunking_comment__": "同步分片列表,代表某个分片中拥有最新数据的分片列表",
					"5": [
						"pYyuBTo0QVeuvY2PrADVJQ",
						"zfP06et8TOuy3NAUirRO1w"
					],
					"6": [
						"EQl7pge5ST26Wnz-lGLB6g",
						"J1PeYw0fSpyNdNl_PJ1PAA"
					],
					"2": [
						"BmcC-XHYR36suKmyGqA_DQ",
						"53scs4-9SuWB-YgZ000SLg"
					],
					"4": [
						"HWbwWFWfRKmiRQXVA7KVrA",
						"539ACU5IQGyjXGcbqDpZcA"
					],
					"3": [
						"o3YjH-7qQpSEX1FQKVUoDQ",
						"DezGojWLSiOKSvEex1vH6Q"
					],
					"1": [
						"jkBt1_D1Sni_3Uo2k8gJow",
						"cyKkS7K2Q1uXY_1F44w9ow"
					],
					"0": [
						"Th7wtq7RQASfrRj5csnz0w",
						"GVifsKOwTlqhxGpgYVOdfQ"
					]
				},
				"rollover_info": {},
				"system": false,
				"timestamp_range": {
					"unknown": true
				}
			}
		},
		"ingest": {
			"pipeline": [
				{
					"id": "xpack_monitoring_6",
					"config": {
						"description": "This pipeline upgrades documents from the older version of the Monitoring API to the newer version (7) by fixing breaking changes in those older documents before they are indexed from the older version (6).",
						"version": 7120099,
						"processors": [
							{
								"script": {
									"source": "ctx._type = null"
								}
							},
							{
								"gsub": {
									"field": "_index",
									"pattern": "(.monitoring-\\w+-)6(-.+)",
									"replacement": "$17$2"
								}
							}
						]
					}
				}
			]
		},
		"index_template": {
			"__index_template_jiankunking_comment__": "模板有两种类型:索引模板和组件模板。 组件模板是可重用的构建块,用于配置映射,设置和别名。 你使用组件模板来构造索引模板,但它们不会直接应用于一组索引。 索引模板可以包含组件模板的集合,也可以直接指定设置,映射和别名。https://blog.csdn.net/UbuntuTouch/article/details/113751797",
			"index_template": {
				"logs": {
					"index_patterns": [
						"logs-*-*"
					],
					"composed_of": [
						"logs-mappings",
						"logs-settings"
					],
					"priority": 100,
					"version": 0,
					"_meta": {
						"description": "default logs template installed by x-pack",
						"managed": true
					},
					"data_stream": {
						"hidden": false
					},
					"allow_auto_create": true
				}
			}
		},
		"data_stream": {
			"data_stream": {
				"ilm-history-5": {
					"name": "ilm-history-5",
					"timestamp_field": {
						"name": "@timestamp"
					},
					"indices": [
						{
							"index_name": ".ds-ilm-history-5-2023.07.18-000024",
							"index_uuid": "ovhEhrqgQmq6MR4pLk2m4A"
						},
						{
							"index_name": ".ds-ilm-history-5-2023.08.17-000025",
							"index_uuid": "5zw095VyRJyWBlAovftH3g"
						},
						{
							"index_name": ".ds-ilm-history-5-2023.09.16-000026",
							"index_uuid": "nIRDt047TmSLIc-P7fW4Ug"
						},
						{
							"index_name": ".ds-ilm-history-5-2023.10.16-000027",
							"index_uuid": "1F4fEU6YTnynu06PWcZ9LQ"
						}
					],
					"generation": 27,
					"_meta": {
						"description": "index template for ILM history indices",
						"managed": true
					},
					"hidden": true,
					"replicated": false,
					"system": false
				}
			}
		},
		"index-graveyard": {
			"__index-graveyard_jiankunking_comment__": "index-graveyard:索引墓碑。记录已删除的索引,并保存一段时间。索引删除是主节点通过下发集群状态来执行的;各节点处理集群状态是异步的过程。例如,索引分片分布在5个节点上,删除索引期间,某个节点是"down"掉的,没有执行删除逻辑;当这个节点恢复的时候,其存储的已删除的索引会被当作孤立资源加入集群,索引死而复活。墓碑的作用就是防止发生这种情况。",
			"tombstones": [
				{
					"__tombstones_jiankunking_comment__": "已删除的索引列表"
				},
				{
					"index": {
						"index_name": "logstash-hic-2023.10.13",
						"index_uuid": "wLl2HTaDQ7-UuKuvpu_Y8w"
					},
					"delete_date_in_millis": 1699068185273
				},
				{
					"index": {
						"index_name": "logstash-mplat-2023.10.13",
						"index_uuid": "sDM_kklIST6ym1cLZ3RKDQ"
					},
					"delete_date_in_millis": 1699068185273
				}
			]
		},
		"index_lifecycle": {
			"policies": {
				"kibana-event-log-policy": {
					"policy": {
						"phases": {
							"hot": {
								"min_age": "0ms",
								"actions": {
									"rollover": {
										"max_size": "50gb",
										"max_age": "30d"
									}
								}
							},
							"delete": {
								"min_age": "90d",
								"actions": {
									"delete": {
										"delete_searchable_snapshot": true
									}
								}
							}
						}
					},
					"headers": {},
					"version": 1,
					"modified_date": 1630029263987,
					"modified_date_string": "2021-08-27T01:54:23.987Z"
				},
				"logs": {
					"policy": {
						"phases": {
							"hot": {
								"min_age": "0ms",
								"actions": {
									"rollover": {
										"max_primary_shard_size": "50gb",
										"max_age": "30d"
									}
								}
							}
						}
					},
					"headers": {},
					"version": 1,
					"modified_date": 1630029123825,
					"modified_date_string": "2021-08-27T01:52:03.825Z"
				}
			},
			"operation_mode": "RUNNING"
		},
		"component_template": {
			"__component_template_jiankunking_comment__": "模板有两种类型:索引模板和组件模板。 组件模板是可重用的构建块,用于配置映射,设置和别名。 你使用组件模板来构造索引模板,但它们不会直接应用于一组索引。 索引模板可以包含组件模板的集合,也可以直接指定设置,映射和别名。https://blog.csdn.net/UbuntuTouch/article/details/113751797",
			"component_template": {
				"logs-settings": {
					"template": {
						"settings": {
							"index": {
								"lifecycle": {
									"name": "logs"
								},
								"codec": "best_compression",
								"query": {
									"default_field": [
										"message"
									]
								}
							}
						}
					},
					"version": 0,
					"_meta": {
						"description": "default settings for the logs index template installed by x-pack",
						"managed": true
					}
				},
				"logs-mappings": {
					"template": {
						"mappings": {
							"dynamic_templates": [
								{
									"strings_as_keyword": {
										"mapping": {
											"ignore_above": 1024,
											"type": "keyword"
										},
										"match_mapping_type": "string"
									}
								}
							],
							"date_detection": false,
							"properties": {
								"@timestamp": {
									"type": "date"
								},
								"ecs": {
									"properties": {
										"version": {
											"ignore_above": 1024,
											"type": "keyword"
										}
									}
								},
								"data_stream": {
									"properties": {
										"namespace": {
											"type": "constant_keyword"
										},
										"type": {
											"type": "constant_keyword",
											"value": "logs"
										},
										"dataset": {
											"type": "constant_keyword"
										}
									}
								},
								"host": {
									"properties": {
										"ip": {
											"type": "ip"
										}
									}
								},
								"message": {
									"type": "text"
								}
							}
						}
					},
					"version": 0,
					"_meta": {
						"description": "default mappings for the logs index template installed by x-pack",
						"managed": true
					}
				}
			}
		}
	},
	"routing_table": {
		"__routing_table_jiankunking_comment__": "内容路由表,存储某个分片位于哪个节点的信息,通过分片找到节点。",
		"indices": {
			"__indices_jiankunking_comment__": "全部索引列表",
			"logstash-bsr-2023.10.23": {
				"shards": {
					"__shards_jiankunking_comment__": "该索引的全部分片列表",
					"5": [
						{
							"state": "STARTED",
							"__state_jiankunking_comment__": "分片可能的状态: UNASSIGNED、INITIALIZING、STARTED、RELOCATING",
							"primary": false,
							"node": "uzGdH3VeRbOlcDIWeKdgIw",
							"__relocating_node_jiankunking_comment__": "正在relocation到哪个节点",
							"relocating_node": null,
							"shard": 5,
							"index": "logstash-bsr-2023.10.23",
							"allocation_id": {
								"id": "TLi8WkbHTrSalefIIyUYgA"
							}
						},
						{
							"state": "STARTED",
							"primary": true,
							"node": "1VQFmt9jQ-6d7fCMjP-vnQ",
							"relocating_node": null,
							"shard": 5,
							"index": "logstash-bsr-2023.10.23",
							"allocation_id": {
								"__jiankunking_comment__": "分片唯一的allocation_id配合in_sync_allocations使用",
								"id": "M7FK6iV0RDSH_DYwSbdhrA"
							}
						}
					]
				}
			}
		}
	},
	"routing_nodes": {
		"__routing_nodes_jiankunking_comment__": "储某个节点存储了哪些分片的信息。通过节点找到分片",
		"unassigned": [],
		"nodes": {
			"hYrrmhLHTx-QHoDmZ2wATg": [
				{
					"state": "STARTED",
					"primary": false,
					"node": "hYrrmhLHTx-QHoDmZ2wATg",
					"relocating_node": null,
					"shard": 1,
					"index": "logstash-bsr-2023.10.23",
					"allocation_id": {
						"id": "ifq-S_55Rs-o-jNWx5JPkQ"
					}
				}
			]
		}
	}
}
相关推荐
marvelyu2 小时前
每天10分钟学会OceanBase系列(Day 20):跨机房容灾实战——构建多数据中心高可用架构
java·大数据·数据库
ZCBUS实时计算2 小时前
金融证券实时数仓建设实践:轻量化实时计算平台落地,实现交易数据端到端秒级处理
大数据·数据库·数据仓库·金融·flink·dba·etl
烟雨江南7853 小时前
2026汽车制造与新能源整车柔性产线Agentic-Workflow白皮书:跨APS_MES_ERP多智能体动态排产与装配容错实战
大数据·网络·人工智能·自动化·ai客服·企业agent
Elasticsearch4 小时前
Elasticsearch:列式索引模式 - Columnar index mode
elasticsearch
zhexunnb4 小时前
专业SAP ERP实施,赋能制造企业构建一体化数字内核
大数据
明源云5 小时前
租赁管理系统软件推荐:如何选到真正好用的不动产租赁管理软件
大数据·人工智能·架构
Meya11276 小时前
机柜可视化不靠复杂坐标!三参数轻量化 U 位管理系统落地思路
大数据·人工智能
行思理7 小时前
OPPO PUSH新消息分类,新手教程
大数据·人工智能·推送
发量惊人的中年网工7 小时前
什么是AI基础设施出海?企业如何选择全链路闭环的海外算力部署方案
大数据·出海·ai基础设施
无忧智库7 小时前
企业数字化底座与数字化转型方案拆解:从贴源数据区到管理分析平台的完整落地路径(PPT)
大数据·架构