Last updated：2022-01-11 13:43:23
This topic describes the basic concepts related to KES.
A cluster is a collection of one or more nodes. The nodes are servers that jointly store all your data. A cluster provides compound indexes and search capabilities for its nodes.
A node is a server in a cluster. Nodes are used to store data and support indexing and search activities in a cluster. KES supports the following four types of nodes:
Data node: a node that stores index data and creates, deletes, modifies, queries, and aggregates documents. Data nodes have high requirements for CPU, memory, and I/O resources. During optimization, you must monitor the status of data nodes. When resources are insufficient in a cluster, you can add nodes to the cluster. If a cluster contains only data nodes, three of them act as master nodes by default.
Master node: a node that performs cluster-related operations. For example, a master node can create or delete indexes, track the nodes that are part of the cluster, and determine the shards to be allocated to nodes. To ensure the stability of a cluster, KES separates master nodes from data nodes, and designates three independent nodes as master nodes. In a large-scale cluster, you can configure master nodes to enhance cluster stability.
Coordinator node: a node that only routes requests, handles search operations, and distributes indexing operations. It behaves as an intelligent load balancer to forward requests to data nodes. Each data node processes the requests locally and returns the results to the coordinator node. After the data is collected, the coordinator node combines the results from all data nodes into a single global result.
An index is a collection of documents with the same characteristics. It is equivalent to a relational database. It is used to store and index associated data. An index is usually identified by a name. The name cannot contain uppercase letters or commas (,), and cannot start with an underscore (_). The name is used to point to the index when you index, search for, update, or delete the documents associated with the index.
A type is usually a logical classification or partition of an index. It is equivalent to a table in a relational database. You can store different types of documents in an index. In Elasticsearch 6.x, an index contains only one type. In Elasticsearch 7.x and later, the concept of type is removed.
A document is a basic information unit that can be indexed. It is equivalent to a row of data in a relational database. Documents can be represented in the JSON format. You can store a number of documents in an index, and all documents must be indexed.
A mapping is used to define an index structure. It is equivalent to a schema in a relational database. KES stores the information about fields in the mapping. The mapping is transmitted as a JSON object in a file.
A field is the smallest unit in KES. It is equivalent to a column of data and similar to a key in the JSON format.
A shard is a segment of an index. When an index contains a large number of documents, one node cannot respond to requests of clients in time due to insufficient memory, disk capacity, or processing capability. In this case, KES allows you to divide one index into multiple shards and distribute them to different nodes for a distributed search. The number of shards must be specified before the index is created, and cannot be changed after the index is created.
KES allows you to set multiple replicas for a shard for the following purposes: