Difference ElasticSeaerch (elastic search database) in a cluster, nodes, and a copy of the fragment

Reference: https://my.oschina.net/kenblog/blog/3009800

https://blog.csdn.net/qq_32106647/article/details/99292402

 

Brief summary follows:

1, the cluster cluster:

es a plurality of nodes in the cluster by definition is the same as the cluster name together. A cluster is equivalent to a class, the class's students are below a node.

If only one node running on a single node called.

 

2, node node:

We can simply be understood as a running instance is a node es.

When you start a es, when you run a node.

Note: In fact, the actual production deployment server environment, a server will deploy a es. Especially because es cpu and memory consumption, so the deployment of multiple nodes will cause the server to seize resources, but reduces the performance of es.

 

3, a copy of the Replica :

By definition is the master copy of the primary shard slice backup copy, if there are three primary slice, then a copy of the replica to correspond with a replica Shard 1X3 = 3 copies of fragments.

Calculated copy number of fragments repilca num X = the number of copies of the main primary shard num number of fragments

An index number of all fragments is calculated copy number repilca num X = number of fragments master primary shard num + number of primary shard num main fragments

For example: a main index has three slices, two copies, then there are six copies of fragments.

You can create an index 0-N copies, the number of copies es created by default is 1.

es replica copy is the key high availability and rapid response search.

 

4, slice shard:

Because the ES is a distributed search engine, the index usually broken down into different sections, and these data is distributed in different nodes slice, a slice data stores only part, all add up to a complete fragmentation index data.

Fragmentation into primary shard and replica copies of the master slice slice.

You must create a master slice, slice copies can not.

An index number can create multiple slices, es default number is five main fragments created, you can determine their actual business based on the number of primary fragments, but note that the number of primary slices Once created can not be modified .

 

5, the index index

Index is similar to database relational database, the database we set up, and then put the data stored in the index.

A es (single node or cluster) can have many index

 

The relationship between fragmentation and copy

Each master slice (primary shard) will not copy fragment (replica shard) exist in the same node, es effective guarantee high data availability.

Example 1: 3 has an index such as fragmentation and 1 copy, then there is a total of 2 * 3 = 6 slices, three main fragments, a copy of the three slices, each slice will correspond to a main a copy of fragmentation.

Example 2: only two nodes, but there are three slices and two copies, this situation will lead to fragmentation can not be fully allocated, since the main fragmentation and slicing a copy can not exist in the same node.

 

The health status of a cluster

Enter get _cluster / health of the Dev Tool Kibana

 

 

status Explanation
green Fragmentation and master copies are normal fragment
yellow All normal primary fragmentation fragmentation, fragmentation could not have a copy of the normal distribution
red Have failed to master slice normal distribution, for example, when a server disk capacity of more than 85%, to create a new index

Guess you like

Origin www.cnblogs.com/wangcp-2014/p/12102938.html