当前位置:网站首页>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
边栏推荐
- Lekao: contents of the provisions on the responsibility of units for fire safety in the fire protection law
- PHP 2D and multidimensional arrays are out of order, PHP_ PHP scrambles a simple example of a two-dimensional array and a multi-dimensional array. The shuffle function in PHP can only scramble one-dim
- Thesis translation: 2022_ PACDNN: A phase-aware composite deep neural network for speech enhancement
- post请求体内容无法重复获取
- Take you ten days to easily finish the finale of go micro services (distributed transactions)
- Yygh-10-wechat payment
- [visual studio 2019] create MFC desktop program (install MFC development components | create MFC application | edit MFC application window | add click event for button | Modify button text | open appl
- [visual studio 2019] create and import cmake project
- to_ Bytes and from_ Bytes simple example
- FastDateFormat为什么线程安全
猜你喜欢
BEAUTIFUL GGPLOT VENN DIAGRAM WITH R
GGPUBR: HOW TO ADD ADJUSTED P-VALUES TO A MULTI-PANEL GGPLOT
小程序链接生成
H5,为页面添加遮罩层,实现类似于点击右上角在浏览器中打开
自然语言处理系列(三)——LSTM
多文件程序X32dbg动态调试
HOW TO CREATE A BEAUTIFUL INTERACTIVE HEATMAP IN R
HOW TO ADD P-VALUES ONTO A GROUPED GGPLOT USING THE GGPUBR R PACKAGE
Research on and off the Oracle chain
HOW TO CREATE AN INTERACTIVE CORRELATION MATRIX HEATMAP IN R
随机推荐
YYGH-9-预约下单
通讯录的实现(文件版本)
Enter the top six! Boyun's sales ranking in China's cloud management software market continues to rise
ESP32 Arduino 引入LVGL 碰到的一些问题
HR wonderful dividing line
HOW TO ADD P-VALUES TO GGPLOT FACETS
HOW TO CREATE AN INTERACTIVE CORRELATION MATRIX HEATMAP IN R
6. Introduce you to LED soft film screen. LED soft film screen size | price | installation | application
ES集群中节点与分片的区别
Those logs in MySQL
The selected cells in Excel form have the selection effect of cross shading
进入前六!博云在中国云管理软件市场销量排行持续上升
【C语言】十进制数转换成二进制数
Leetcode739 每日温度
HOW TO CREATE A BEAUTIFUL INTERACTIVE HEATMAP IN R
Leetcode922 按奇偶排序数组 II
HOW TO CREATE A BEAUTIFUL INTERACTIVE HEATMAP IN R
How to Add P-Values onto Horizontal GGPLOTS
SCM power supply
GGPUBR: HOW TO ADD ADJUSTED P-VALUES TO A MULTI-PANEL GGPLOT