Elasticsearch-shard&replica mechanism (study notes)

1. Shard&replica mechanism
(1) The index contains multiple shards.
(2) Each shard is a minimum unit of work, carrying part of the data, is an instance of Lucene, and has complete indexing and request processing capabilities.
(3) When adding or subtracting nodes, the shard will automatically load balance among nodes.
(4) Primary shard and replica shard; each document must only exist in one primary shard and the corresponding replica shard, and it is impossible to exist in multiple primary shards.
(5) The replica shard is a copy of the primary shard, which is responsible for fault tolerance and bears the load of read requests.
(6) The number of primary shards is fixed when the index is created, and the number of replica shards can be modified at any time.
(7) The default number of primary shards is 5, and the default replica is 1. There are 10 shards, 5 primary shards, and 5 replica shards by default.
(8) The primary shard cannot be placed on the same node as its own replica shard (otherwise the node is down, the primary shard and the replica are lost, and cannot be used for fault tolerance), but it can be placed on the same node as the replica shard of other primary shards. On one node.
2. What is the
creation of an index in a single node environment? (1) In a single node environment, create an index with 3 primary shards and 3 replica shards.
(2) The cluster status is yellow.
(3) At this time, only 3 primary shards will be allocated to only one node, and the other 3 replica shards cannot be allocated.
(4) The cluster can work normally, but once the node is down, all the data is lost, and the cluster is unavailable and cannot accept any requests.
 

Guess you like

Origin blog.csdn.net/Micheal_yang0319/article/details/105643358