当前位置:网站首页>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进行同步,将导致自己的数据被清掉
边栏推荐
- XML learning notes
- 从位图到布隆过滤器,C#实现
- [vscade] preview MD file
- Processing of slice loss in ArcGIS mosaic dataset
- Account management, database building and four engines + cases of MySQL
- Oracle database basics concepts
- 滑环选型选购时需要注意的技巧
- “message“:“Bad capabilities. Specify either app or appTopLevelWindow to create a session“
- Great vernacular with high concurrency (I)
- Lwip之ARP模块实现
猜你喜欢

3線spi屏幕驅動方式

解决unable to create a folder to save the sketch: mkdir sketch

3-wire SPI screen driving mode

What are the skills and methods for slip ring installation

滑环选型选购时需要注意的技巧

Com. Faster XML. Jackson. DataBind. Exc.mismatchedinputexception: tableau ou chaîne attendu. At [Source: X

Oracle database basics concepts
![The [MySQL] time field is set to the current time by default](/img/40/5f1d3448259ab703c4b5dc29713a99.png)
The [MySQL] time field is set to the current time by default

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

Timing mechanism of LwIP
随机推荐
CPU exception handling
Esp32 experiment - self built web server distribution network 02
Gaussian and Summary Stats
CPU的异常处理
Is it safe to open a securities account online? Is it reliable to speculate in stocks by mobile phone
memcached基础1
从位图到布隆过滤器,C#实现
Law of Large Numbers
Oracle database basics concepts
2022 Health Expo, Shandong health care exhibition, postpartum health and sleep health exhibition
30《MySQL 教程》MySQL 存储引擎概述
自定义JSP[if,foreach,数据,select]标签
Statistical Hypothesis Testing
Is it safe for CITIC Securities Commission to open an online account and speculate in stocks
CH423要如何使用,便宜的国产IO扩展芯片
07 | 工作流设计:如何设计合理的多人开发模式?
记录一次换行符引起的bug
“message“:“Bad capabilities. Specify either app or appTopLevelWindow to create a session“
buuctf-pwn write-ups (6)
温故知新--常温常新