当前位置:网站首页>Differences between nodes and sharding in ES cluster
Differences between nodes and sharding in ES cluster
2022-07-02 12:05:00 【What about Saipan】
At first I got confused , Think partition is node
node : Nodes are our hosts one by one , You can also understand it as one by one ES
Fragmentation : Sharding is to shard the data originally stored on a node , Then store it to different nodes .
Slice is divided into main slice and sub slice , Secondary fragmentation is used for data copying
For example, create an index library here
PUT /test
{
"settings": {
"number_of_shards": 3, // Number of slices
"number_of_replicas": 1 // Copy number
},
"mappings": {
"properties": {
// mapping Mapping definition ...
}
}
}This means that the data of the index database will be stored in three partitions , Which node will the three partitions be distributed to? By default, there are ES control , At the same time, it can also be controlled by the master node

es01、es02、es03 Represents three nodes , The entity asterisk indicates that this node is the primary node , The number on the right is the number of slices , And it shows the distribution of slices on nodes
Let's look at the process of inserting a document , In this way, we can clearly understand the difference between nodes and partitions

The process :
1) Add a new one id=1 Documents
2) Master node pair id do hash operation , If you get 2, Should be stored in shard-2
3)shard-2 The main partition of is node3 node , Route data to node3
4)node3 Save the document
5)node3 Synchronize data to shard-2 Copy of replica-2, stay node2 node
6) Return the result to coordinating-node node
7) Return the result to the user
annotation :
1)shard It means dividing into pieces
2)hash Algorithm will document id Get the sequence number of slices by taking the remainder with the number of slices , Then the document data is stored in the host where the partition is located data Go to the data node
3) When the master partition saves data , Data backup should also be carried out for secondary fragmentation
Now you should know the difference between sharding and nodes
边栏推荐
猜你喜欢

The selected cells in Excel form have the selection effect of cross shading
![[geek challenge 2019] upload](/img/04/731323142161a4994c14fedae38b81.jpg)
[geek challenge 2019] upload

Pyqt5+opencv project practice: microcirculator pictures, video recording and manual comparison software (with source code)

H5, add a mask layer to the page, which is similar to clicking the upper right corner to open it in the browser

How does Premiere (PR) import the preset mogrt template?

The position of the first underline selected by the vant tabs component is abnormal

HR wonderful dividing line

How to Easily Create Barplots with Error Bars in R
![[visual studio 2019] create and import cmake project](/img/51/6c2575030c5103aee6c02bec8d5e77.jpg)
[visual studio 2019] create and import cmake project

Take you ten days to easily finish the finale of go micro services (distributed transactions)
随机推荐
SSH automatically disconnects (pretends to be dead) after a period of no operation
Le tutoriel F - String le plus facile à comprendre de l'histoire.
Dynamic debugging of multi file program x32dbg
(C语言)3个小代码:1+2+3+···+100=?和判断一个年份是闰年还是平年?和计算圆的周长和面积?
HOW TO EASILY CREATE BARPLOTS WITH ERROR BARS IN R
Deep understanding of NN in pytorch Embedding
Jenkins用户权限管理
Dynamic memory (advanced 4)
CMake交叉编译
自然语言处理系列(三)——LSTM
Analyse de l'industrie
YYGH-BUG-05
PyTorch nn. Full analysis of RNN parameters
Log4j2
PyTorch中repeat、tile与repeat_interleave的区别
进入前六!博云在中国云管理软件市场销量排行持续上升
GGPLOT: HOW TO DISPLAY THE LAST VALUE OF EACH LINE AS LABEL
How to Add P-Values onto Horizontal GGPLOTS
BEAUTIFUL GGPLOT VENN DIAGRAM WITH R
easyExcel和lombok注解以及swagger常用注解