当前位置:网站首页>Keepalived 实现 Redis AutoFailover (RedisHA)14
Keepalived 实现 Redis AutoFailover (RedisHA)14
2022-06-27 00:24:00 【franket】
下面是它的区别
4c4
< router_id LVS_redis-b
router_id LVS_redis-a 19c19
< priority 139
priority 138priority 的范围是 1-255
Note: priority 值高的会自动变成 master , 所以在分配优先级时master 要设置一个相对高一点的值,但不能比 backup 高过weight 调整值,否则keepalived检查发现服务不可用了,将相应的priority 减小了之后,发现还是比backup的优先级高,于是还会继续充当master ,不放开 VIP,这时客户端访问就不会获得期望的结果
启动顺序
这个redis+keepalived 集群的启动顺序相当有讲究,否则会出意外
启动充当master的redis (或者生产中正好有一台正在运行的redis)
启动充当slave的redis
在slave上执行 SLAVEOF 与master进行同步 (选择一个业务低峰点)
调整master上的keepalived priority 使它的值 s.priority < m.priority < s.priority+weight (是为了master被keepalived检查并认定失效后,slave可以通过自已的优先级成功竞选成为新的master)
启动master上的keepalived
启动slave上的keepliaved
Note: 这种方式只可以抗击一次master的非计划故障切换,或计划性切换,如果要再次使用,得重新手动按照上面顺序进行构建,之所以不自动化,是因为,SLAVEOF是一个有杀伤性的命令,正常情况会对服务器造成显著压力,意外情况会毁掉master上的数据,比如和一个空的redis进行同步,将导致自己的数据被清掉
边栏推荐
- Special topic II on mathematical physics of the sprint strong foundation program
- 基于SSMP的宠物医院管理系统
- 07 | 工作流设计:如何设计合理的多人开发模式?
- 目前哪个证券公司炒股开户是最好最安全的?
- Processing of slice loss in ArcGIS mosaic dataset
- Review the old and know the new -- constant renewal at normal temperature
- 玩转OLED,U8g2动画,增长数字和随机三角形等
- Is it safe to open a securities account online? Is it reliable to speculate in stocks by mobile phone
- MATLAB data type - character type
- Gaussian and Summary Stats
猜你喜欢

【Vscode】预览md文件

3线spi屏幕驱动方式

Buuctf PWN write UPS (6)

CPU exception handling

Competition Registration | one of the key ai+ scientific computing competitions - China open source scientific software creativity competition, competing for 100000 bonus!

Unable to create a folder to save the sketch: MKDIR sketch

How to control the quality of HD slip ring in the production process

基于SSMP的宠物医院管理系统

一键加速索尼相机SD卡文件的复制操作,文件操作批处理教程

Moher College - SQL injection vulnerability test (error reporting and blind note)
随机推荐
Central Limit Theorem
buuctf-pwn write-ups (6)
Lwip之定时机制
3線spi屏幕驅動方式
高清滑环生产过程当中的质量如何把控
CPU的异常处理
自定义MVC(导成jar包)+与三层架构的区别+反射+面试题
com.fasterxml.jackson.databind.exc.MismatchedInputException: Expected array or string. at [Source:x
剑指 Offer 10- II. 青蛙跳台阶问题
Live review | Ziya &ccf TF: Discussion on software supply chain risk management technology under cloud native scenario
buuctf-pwn write-ups (6)
com. fasterxml. jackson. databind. exc.MismatchedInputException: Expected array or string. at [Source:x
MATLAB data type - character type
Account management, database building and four engines + cases of MySQL
光谱共焦如何测量玻璃基板厚度
The most difficult 618 in history, TCL won the first place in both jd.com and tmall.com shares in the TV industry
05 | standard design (Part 2): how to standardize the different styles of commit information, which are difficult to read?
How to easily describe the process of machine learning?
matlab数据类型 —— 字符型
Beyond lithium battery -- the concept of battery in the future