当前位置:网站首页>Cloud Migration Practice of Redis
Cloud Migration Practice of Redis
2022-08-10 13:21:00 【51CTO】
简介
随着云产品的完善,Most companies have already started using cloud products,Cloud products can indeed solve many infrastructure conveniences,Improve the stability of the business structure,如何将RedisData is migrated online to the cloud,And guarantee the loss of business,The following points must be considered from the selection of migration scenarios and tools:
兼容性:RedisThe Community Edition is backward compatible,在上云的过程中,Try to keep the major version consistent,In order to avoid the problem of client incompatibility caused by version inconsistency
迁移工具:While fully considering the functionality of the tool,Convenience and operability are also important considerations,The tool needs to have a complete logging and monitoring system
数据完成性:数据大于一切,Data integrity cannot be guaranteed,Do not do related actions,RedisAs cached data changes faster,It is necessary to perform data comparison and related work in real time
Effective assessment of resources: Resource specifications on cloud resources have been standardized,When evaluating resources on the cloud,Fully refer to the self-built computer room example,As far as possible higher than self-built resources
迁移流程
资源评估
- Fully consider self-built computer roomRedis实例的架构,Extract instances from monitoring systemsQPS,内存大小,,连接数,Bandwidth and other three indicators,The specifications and performance of the instances on the cloud need to be self-builtRedis对齐,Instances on the cloud have bandwidth limitations,这点需要注意
- Try to use the slave library of the self-built instance as the data source for data synchronization,In order to reduce the pressure on the business to access the main library
兼容性评估
版本确认
Try to keep the major version of the instance on the cloud consistent with the self-built instance,The current major version is 4.0
Command compatibility confirmation
Cloud vendors in order to support some features,Castrated some commands,For command compatibility support, see the cloud vendor documentation
Whether to use a password
Some older businesses may not support passwords,在上云的过程中,Keep it as confidential as possible,Even some apps have passwords,也可以兼容
业务评估
是否使用lua脚本
检查原因:社区版4.0.2Versions and below will not synchronize the secondary slave libraryluaScript to tertiary slave library,可对Redis进行monitor抓包查看
解决方法:同步主库
是否使用lua客户端
检查原因:Some applications applyluaClients may use built-in domain name resolution,导致无法解析Redis域名
解决方法:Modify the built-in domain name resolution or use the system domain name resolution
Whether read and write requests are detachable
检查原因:The main library read and write cannot be disassembled,There is no guarantee that a read and write request of an application will be completely migrated,This leads to data inconsistency issues
解决方法:Use a proxy for the main library,一般使用Haproxy
Identify the business visitor
检查原因:Prevent business leakage,导致数据不一致
解决方法:Turn on regularlyredis monitor或tcpdumpCapture packets of master and slave instances,Learn about business visitors
Check whether the service has a reconnection mechanism
检查原因:There is research and development confirmed
解决方法:The application side tries to maintain the reconnection mechanism as much as possible,No reconnection mechanism,更改配置后,The business application needs to be restarted
确定方案
方案实施
- Build a data synchronization tool,A completed monitoring system is required,The source and target instances need to have complete logs,Periodically capture packets in real time for instances
- 迁移过程中,R&D leaders and operation and maintenance personnel participated in the whole process,Avoid unforeseen problems
- 迁移时间,The off-peak business period should be selected
Migration closes
善后处理
迁移完成后,After confirming that there is no abnormality in the business,Try to close the source instance as much as possible,及时发现问题,And real-time packet capture of the agent,Avoid data inconsistencies caused by missing migrations
总结经验
Summarize the problems that occurred during the migration process,并形成文档,It is convenient for subsequent migration and summary
迁移方案
原理
This program adopts open sourceRedis-shake作为数据同步工具,haroxy作为代理.架构如下图:

迁移方法
数据同步
Open source is availableRedis数据同步工具,redis-shake的基本原理就是模拟一个从节点加入源redis集群,首先进行全量拉取并回放,然后进行增量的拉取(通过psync命令),具体配置请参考 文档

数据比对
Open source data comparison tools can be used,By comparing the source end and the destination end in fullredis中的数据的方式来进行数据校验,The comparison method is through multiple rounds of comparison:每次都会抓取源和目的端的数据进行差异化比较,记录不一致的数据进入下轮对比(记录在sqlite3 db中).然后通过多伦比较不断收敛,减少因数据增量同步导致的源库和目的库的数据不一致.最后sqlite中存在的数据就是最终的差异结果.具体配置请参考 文档

业务迁移
For business only,只提供了redis地址和haproxy的地址,The business configuration needs to be modified to haproxy地址,haproxy的配置如下:
总结
- Be sure to do a plan research before migrating、资源评估,兼容性评估
- Monitoring is the eyes of operation and maintenance personnel,After program selection,监控是必不可少的
- 业务迁移,Try to choose a low-peak business period,and do relevant tests
参考
redis数据同步
redis 数据比对
边栏推荐
- Jenkins修改默认主目录
- M²BEV: Multi-Camera Joint 3D Detection and Segmentation with Unified Bird’s-Eye View Representation
- bgp双平面实验 路由策略控制流量
- I would like to ask the big guys, how to solve this error when cdc oracle initializes a 3 million table task running
- MYSQL误删数据恢复
- 3DS MAX 批量导出文件脚本 MAXScript 带界面
- Import other custom namespaces in C#
- [Advanced Digital IC Verification] Difference and focus analysis between SoC system verification and IP module verification
- Codeforces Round #276 (Div. 1) B. Maximum Value
- 交换机的基础知识
猜你喜欢

Redis 定长队列的探索和实践

Jiugongge lottery animation

3DS MAX batch export file script MAXScript with interface

Jenkins修改端口号, jenkins容器修改默认端口号

M²BEV: Multi-Camera Joint 3D Detection and Segmentation with Unified Bird’s-Eye View Representation

没有接班人,格力只剩“明珠精选”

Jenkins修改默认主目录

Ethernet channel 以太信道

燃炸!字节跳动成功上岸,只因刷爆LeetCode算法面试题

11 + chrome advanced debugging skills, learn to direct efficiency increases by 666%
随机推荐
2022-08-09:以下go语言代码输出什么?A:否,会 panic;B:是,能正确运行;C:不清楚,看投票结果。 package main import ( “fmt“ “syn
SenseTime self-developed robotic arm, the first product is an AI chess-playing robot: Guo Jingjing is also invited as an endorsement
LeetCode·297.二叉树的序列化与反序列化·DFS·BFS
mSystems | Zhongnong Wang Jie Group Reveals the Mechanisms Affecting Soil "Plastic Interstitial" Microbial Communities
C# 当前上下文中不存在InitializeComponent()
How to describe multiple paragraphs with different font settings in Open Office XML format
mSystems | 中农汪杰组揭示影响土壤“塑料际”微生物群落的机制
神经网络可视化有3D版本了,美到沦陷!(已开源)
作业8.9 构建TCP协议的服务器
Efficient and Robust 2D-to-BEV Representation Learning via Geometry-guided Kernel Transformer 论文笔记
kubernetes介绍
Import other custom namespaces in C#
生成树协议STP(Spanning Tree Protocol)
CodeForces-834C
11+ chrome高级调试技巧,学会效率直接提升666%
YTU 2295: KMP模式匹配 一(串)
Jiugongge lottery animation
C#报错 The ‘xmins‘ attribute is not supported in this context
Network Saboteur
把相亲角搬到海外,不愧是咱爸妈