一. 测试环境
二. 操作步骤
[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