Redis故障转移日志分析

这篇博客详细记录了一次Redis故障转移的过程。在测试环境中,6381成为新主节点,6380转为其从节点。日志显示,6379因被强制关闭而无日志记录;6380在10:37:04发现与原主节点失联,并开始复制6381;6381在10:37:06接受晋升为主节点的命令并处理复制请求;sentinel节点进行主观下线判断及投票,最终完成故障转移并更新拓扑结构。
摘要由CSDN通过智能技术生成

一. 测试环境

二. 操作步骤

[root@orcl19c redis]# ps -ef|grep redis
root      28166      1  0 09:38 ?        00:00:03 redis-server *:6379
root      28173      1  0 09:39 ?        00:00:03 redis-server *:6380
root      28178      1  0 09:39 ?        00:00:03 redis-server *:6381
root      29123      1  0 09:41 ?        00:00:04 redis-sentinel *:26379 [sentinel]
root      29127      1  0 09:41 ?        00:00:05 redis-sentinel *:26380 [sentinel]
root      29131      1  0 09:41 ?        00:00:05 redis-sentinel *:26381 [sentinel]
root      34767  19244  0 09:53 pts/7    00:00:00 redis-cli -p 26379
root      51956  14357  0 10:36 pts/6    00:00:00 grep --color=auto redis
[root@orcl19c redis]# kill -9 28166

测试结果:192.168.48.60 6381 称为新的主节点,6380称为6381的从节点

三. 日志分析

1. 6379

因为6379是被强制Kill的,所以日志没有任何日志

s/kernel/mm/transparent_hugepage/enabled' as root, and add it to your /etc/rc.local in order to retain the setting after a reboot. Redis must be restarted after THP is disabled.
28166:M 02 Jul 09:38:58.904 * DB loaded from disk: 0.000 seconds
28166:M 02 Jul 09:38:58.904 * The server is now ready to accept connections on port 6379
28166:M 02 Jul 09:39:09.950 * Slave 127.0.0.1:6380 asks for synchronization
28166:M 02 Jul 09:39:09.950 * Full resync requested by slave 127.0.0.1:6380
28166:M 02 Jul 09:39:09.950 * Starting BGSAVE for SYNC with target: disk
28166:M 02 Jul 09:39:09.951 * Background saving started by pid 28176
28176:C 02 Jul 09:39:09.957 * DB saved on disk
28176:C 02 Jul 09:39:09.958 * RDB: 4 MB of memory used by copy-on-write
28166:M 02 Jul 09:39:09.987 * Background saving terminated with success
28166:M 02 Jul 09:39:09.987 * Synchronization with slave 127.0.0.1:6380 succeeded
28166:M 02 Jul 09:39:12.461 * Slave 127.0.0.1:6381 asks for synchronization
28166:M 02 Jul 09:39:12.461 * Full resync requested by slave 127.0.0.1:6381
28166:M 02 Jul 09:39:12.461 * Starting BGSAVE for SYNC with target: disk
28166:M 02 Jul 09:39:12.461 * Background saving started by pid 28181
28181:C 02 Jul 09:39:12.465 * DB saved on disk
28181:C 02 Jul 09:39:12.465 * RDB: 4 MB of memory used by copy-on-write
28166:M 02 Jul 09:39:12.503 * Background saving terminated with success
28166:M 02 Jul 09:39:12.503 * Synchronization with slave 127.0.0.1:6381 succeeded
------------------------------------------------------------------------------------------------------

2. 6380

(1) 10:37:04发现与原主节点6379失联,10:37:07.251街道sen

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值