当前位置:网站首页>Redis cluster
Redis cluster
2022-07-06 09:14:00 【~Pompeii】
Catalog
Redis And cluster colony
1. Cluster introduction
Cluster is to use the network to connect several computers , And provide a unified way of Management , Make it present the service effect of single machine
2. Cluster function
1. Disperse the access pressure of a single server , Load balancing
2. Disperse the storage pressure of a single server , Achieve scalability
3. Reduce the business disaster caused by single server downtime
3. Cluster data storage design
%16384 It's modular operation
If you add another server , Or a server suddenly goes down , What do I do ?
37 The small box is called ” Slot “
If you add another server now , Or a server suddenly goes down , What do I do ?
The following example is 3 Servers , Another server has been added , Turned into 4 individual , Then each of the other three servers takes out a part key To the new server , To optimize .
The so-called adding nodes and removing nodes actually change the location of the slot
4. The design of communication within the cluster
1. Now there are clients to access the database , Conduct key Lookup ,key After being calculated by two algorithms , obtain key Location of the corresponding storage slot , Suppose the result of the calculation is A Inside 35 Slot No , If one hit, it will return directly , If you miss ,35 Slot number will be based on this key Search for , Tell the client that it is B In that slot , The client will go again B Find the slot inside ( Be careful : No A Go find , Is the client to find , Avoid clients from going to other places for many times and looking for them one by one )
2. You can hit it twice at most
Be careful : The number of slots in each database is not necessarily continuous , It's scattered
5. Cluster building method
1. Native installation ( Single command )
1) Configure server (3 Lord 3 from )
2) Establish communication (Meet)
3) Slotting (Slot)
4) Build master slave (master-slave)
2. Tool installation ( The batch )
6.cluster To configure
1.cluster-enabled yes|no
Add the server as a node
2.cluster-config-file
cluster Profile name , This file is automatically generated .
If we give you a name , Will automatically generate the specified name cluster-config-file ;
If we don't give you a name , A default name will be automatically generated cluster-config-file ;
give an example :cluster-config-file nodes-6379.conf
And it's only used to quickly find files .
( notes : We try to assign a name , Because it is generated by default in the case of a large number of nodes cluster-config-file The file names are the same , Easy to confuse )
3.cluster-node-timeout
Node service response timeout , Used to determine whether the node is offline or switched to a slave node
4.cluster-migration-barrier
master Connected slave Minimum quantity
7.cluster Node operation command
1. View the cluster node information
cluster nodes
2. Enter a slave node redis, Switch its master node
cluster replicate <master-id>
3. Find a new node , Add master node
cluster meet ip:port
4. Ignore one without solt The node of
cluster forget <id>
5. Manual failover
cluster failover
8.redis-trib command
redis-trib Equivalent to a script , hold cluster Some of the commands are optimized , In practice cluster Own command or redis-trib Everything can be ordered
1. Add a node
redis-trib.rb add-node
2. Delete node
redis-trib.rb del-node
3. The shard
redis-trib.rb reshard
边栏推荐
- [OC]-<UI入门>--常用控件-提示对话框 And 等待提示器(圈)
- Export IEEE document format using latex
- Improved deep embedded clustering with local structure preservation (Idec)
- LeetCode:498. Diagonal traversal
- MongoDB 的安装和基本操作
- Kratos战神微服务框架(三)
- LeetCode41——First Missing Positive——hashing in place & swap
- QML type: overlay
- Redis之持久化实操(Linux版)
- KDD 2022论文合集(持续更新中)
猜你喜欢
甘肃旅游产品预订增四倍:“绿马”走红,甘肃博物馆周边民宿一房难求
Advance Computer Network Review(1)——FatTree
Blue Bridge Cup_ Single chip microcomputer_ Measure the frequency of 555
Digital people anchor 618 sign language with goods, convenient for 27.8 million people with hearing impairment
How to intercept the string correctly (for example, intercepting the stock in operation by applying the error information)
Intel distiller Toolkit - Quantitative implementation 3
【图的三大存储方式】只会用邻接矩阵就out了
Different data-driven code executes the same test scenario
注意力机制的一种卷积替代方式
Nacos 的安装与服务的注册
随机推荐
Using C language to complete a simple calculator (function pointer array and callback function)
Booking of tourism products in Gansu quadrupled: "green horse" became popular, and one room of B & B around Gansu museum was hard to find
Redis之核心配置
LeetCode41——First Missing Positive——hashing in place & swap
Redis之cluster集群
Kratos战神微服务框架(一)
xargs命令的基本用法
Advanced Computer Network Review(5)——COPE
Different data-driven code executes the same test scenario
A convolution substitution of attention mechanism
[OC foundation framework] - [set array]
Multivariate cluster analysis
[oc]- < getting started with UI> -- learning common controls
Redis之Bitmap
[oc foundation framework] - < copy object copy >
The carousel component of ant design calls prev and next methods in TS (typescript) environment
Blue Bridge Cup_ Single chip microcomputer_ Measure the frequency of 555
KDD 2022 paper collection (under continuous update)
Li Kou daily question 1 (2)
Pytest之收集用例规则与运行指定用例