Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and beauty - Es storage directory analysis
Es storage directory analysis
Generally speaking, there are three kinds of data files generated by Elasticsearch, namely status, index and translog.

Looking at the ES storage directory, you can find that there are multiple _state directories and files with suffixes. They are stored below. take for example

The contents of these st files are called metadata in the es source code, which caches information such as NodeState, ClusterState, IndexState and ShardState.

nodes/0/_state/:

This directory is node-level, and the global- 1.st file in this directory stores some metadata except IndexMetaData, that is, some cluster-level configurations and templates. NodeId is stored in node-0.st

nodes/0/indexes/2s CRM 6 nuqooxun 2 ewtrnjw/_ state/:

This directory is index-level, 2Scrm6nuQOOxUN2ewtrNJw is IndexId, and the state-2.st file in this directory stores IndexMetaData.

nodes/0/indexes/2s CRM 6 nuqooxun 2 ewtrnjw/0/_ state/:

This directory is shard level, and the state-0.st under this directory stores ShardStateMetaData, which contains information such as whether it is primary or not, allocationId, etc.

As you can see, the metadata related to the cluster and the metadata of the index are stored in different directories. In addition, cluster-related elements will be stored on all master nodes and data nodes, while indexed elements will be stored on all master nodes and data nodes that store indexed data.