当前位置:网站首页>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
边栏推荐
- Fabric.js 3个api设置画布宽高
- [QT] Qt development environment installation (QT version 5.14.2 | QT download | QT installation)
- Develop scalable contracts based on hardhat and openzeppelin (I)
- 行業的分析
- 测试左移和右移
- CMake交叉编译
- Codeforces 771 div2 B (no one FST, refers to himself)
- Larvel modify table fields
- 字符串回文hash 模板题 O(1)判字符串是否回文
- [geek challenge 2019] upload
猜你喜欢

How to Visualize Missing Data in R using a Heatmap

Lekao: contents of the provisions on the responsibility of units for fire safety in the fire protection law

(C语言)3个小代码:1+2+3+···+100=?和判断一个年份是闰年还是平年?和计算圆的周长和面积?

The computer screen is black for no reason, and the brightness cannot be adjusted.

测试左移和右移

YYGH-BUG-04
![[geek challenge 2019] upload](/img/04/731323142161a4994c14fedae38b81.jpg)
[geek challenge 2019] upload

How to Easily Create Barplots with Error Bars in R

BEAUTIFUL GGPLOT VENN DIAGRAM WITH R

【工控老马】西门子PLC Siemens PLC TCP协议详解
随机推荐
Pyqt5+opencv project practice: microcirculator pictures, video recording and manual comparison software (with source code)
xss-labs-master靶场环境搭建与1-6关解题思路
YYGH-10-微信支付
PyTorch nn. Full analysis of RNN parameters
B high and beautiful code snippet sharing image generation
Yygh-9-make an appointment to place an order
还不会安装WSL 2?看这一篇文章就够了
How to Create a Beautiful Plots in R with Summary Statistics Labels
This article takes you to understand the operation of vim
HOW TO ADD P-VALUES TO GGPLOT FACETS
From scratch, develop a web office suite (3): mouse events
通讯录的实现(文件版本)
File operation (detailed!)
输入一个三位的数字,输出它的个位数,十位数、百位数。
Power Spectral Density Estimates Using FFT---MATLAB
Mish-撼动深度学习ReLU激活函数的新继任者
史上最易懂的f-string教程,收藏这一篇就够了
post请求体内容无法重复获取
HOW TO CREATE A BEAUTIFUL INTERACTIVE HEATMAP IN R
Natural language processing series (II) -- building character level language model using RNN