当前位置:网站首页>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进行同步,将导致自己的数据被清掉
边栏推荐
- redis详细教程
- 简单快速的数网络(网络中的网络套娃)
- 【Vscode】预览md文件
- Flink 实战问题(七):No Watermark(Watermarks are only available EventTime is used)
- At present, which securities company is the best and safest to open an account for stock speculation?
- XML learning notes
- Oracle 數據庫基本知識概念
- 用代码生成流程图,Markdown的使用方法
- Special topic II on mathematical physics of the sprint strong foundation program
- Is it safe for CITIC Securities Commission to open an online account and speculate in stocks
猜你喜欢

Batch generate folders based on file names

光谱共焦如何测量玻璃基板厚度

05 | standard design (Part 2): how to standardize the different styles of commit information, which are difficult to read?

Esp32-solo development tutorial to solve config_ FREERTOS_ UNICORE problem

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

Statistical Hypothesis Testing

【Vscode】预览md文件

ArcGIS 镶嵌数据集切片丢失问题处理

How to use ch423? Cheap domestic IO expansion chip

Statistical Hypothesis Testing
随机推荐
buuctf-pwn write-ups (6)
根据文件名批量生成文件夹
CEC-I 中华学习机使用说明与问答
From bitmap to bloom filter, C # implementation
Is it safe for CITIC Securities Commission to open an online account and speculate in stocks
How to control the quality of HD slip ring in the production process
05 | standard design (Part 2): how to standardize the different styles of commit information, which are difficult to read?
JS library for number formatting
Statistical Hypothesis Testing
解决unable to create a folder to save the sketch: mkdir sketch
Basic introduction to C program structure Preview
LeetCode 142. Circular linked list II
CPU exception handling
2022年地理信息系统与遥感专业就业前景与升学高校排名选择
Overview of Freescale MCU
Gaussian and Summary Stats
3線spi屏幕驅動方式
find_ Detailed use guide of CIRC
Redis detailed tutorial
世界很大,有人把二维码纹在脖子上