一、前言
本文章通过关于java的jedis(2.6.0)的redis客户端连接驱动包,对配置的redis哨兵+主从读写模式配置进行示例代码验证,详细参见具体配置步骤&示例代码说明部分。
二、配置步骤
1. 安装redis(参考其他文章教程),并配置主从模式(参考其他相关文章,这里分别在本地通过配置进行模拟三台主从服务器,端口分别为6379、7380、6381)
2. 从解压安装文件复制sentinel.conf文件模板(具体操作如下,这边在一台服务器(192.168.1.202)上模拟三个sentinel哨兵服务器配置,分别对应下面的sentinel26379.conf 、sentinel26380.conf、sentinel26381.conf 配置文件)
[root@centos6 redis-4.0.2]# cp /home/soft/redis-4.0.2/sentinel.conf /etc/redis/sentinel26379.conf@b@[root@centos6 redis-4.0.2]# cp /home/soft/redis-4.0.2/sentinel.conf /etc/redis/sentinel26380.conf@b@[root@centos6 redis-4.0.2]# cp /home/soft/redis-4.0.2/sentinel.conf /etc/redis/sentinel26381.conf
3. 分别修改sentinel26379.conf 、sentinel26380.conf、sentinel26381.conf配置
..@b@#三个配置文件,分别设置为23679、26380、26381@b@port 26379@b@@b@...@b@@b@#三个配置文件相同@b@sentinel monitor mymaster 192.168.1.202 6381 1@b@...@b@#三个配置文件相同,其中密码根据情况进行设置,这边不用密码,另外6380、6379是在本地模拟两台redis的slave备用服务器@b@#sentinel auth-pass mymaster 123456@b@sentinel config-epoch mymaster 2237@b@sentinel leader-epoch mymaster 2237@b@sentinel known-slave mymaster 192.168.1.202 6380@b@sentinel known-slave mymaster 192.168.1.202 6381@b@@b@sentinel failover-timeout mymaster 18000@b@sentinel down-after-milliseconds mymaster 5000@b@@b@#下面redis-sentinel启动自动生成,无需手动配置@b@sentinel known-sentinel mymaster 192.168.1.202 26380 51df014024045d5382a408c4afe1f9c3287bd0e3@b@sentinel known-sentinel mymaster 192.168.1.202 26381 a3b1a33e0d2dbe70b8de78dba808a1e0a6e6fc5c@b@sentinel known-sentinel mymaster 192.168.1.202 26379 3deef21eea5f4a5198f71236bd1d0fc859c28ff7
4. 先启动三台redis主从服务器,再分别启动哨兵服务器,具体启动脚本顺序参考如下
[root@centos6 redis]# /usr/local/bin/redis-server /etc/redis/6379.conf@b@[root@centos6 redis]# /usr/local/bin/redis-server /etc/redis/6380.conf@b@[root@centos6 redis]# /usr/local/bin/redis-server /etc/redis/6381.conf
[root@centos6 redis]# /usr/local/bin/redis-sentinel /etc/redis/sentinel26379.conf --protected-mode no@b@[root@centos6 redis]# /usr/local/bin/redis-sentinel /etc/redis/sentinel26380.conf --protected-mode no@b@[root@centos6 redis]# /usr/local/bin/redis-sentinel /etc/redis/sentinel26381.conf --protected-mode no
三、代码示例
完整的项目点击"关于redis四种不同模式(单例/主从/哨兵/集群)java示例代码项目下载(含完整依赖包)"进行下载
package com.xwood.redis.sentinel;@b@@b@import java.util.HashSet;@b@import java.util.Set;@b@@b@import redis.clients.jedis.Jedis;@b@import redis.clients.jedis.JedisSentinelPool;@b@@b@public class RedisSentinelTest {@b@ @b@ private static JedisSentinelPool jSentinelPool;@b@@b@ public static void main(String[] args) throws Exception{ @b@ @b@ Set<String> sentinels = new HashSet<String>(); @b@ sentinels.add("192.168.1.202:26379");@b@ sentinels.add("192.168.1.202:26380");@b@ sentinels.add("192.168.1.202:26381");@b@ @b@ String clusterName = "mymaster" ; @b@ @b@ JedisSentinelPool jsentinelPool = new JedisSentinelPool(clusterName,sentinels); @b@ Jedis jedis = null; @b@ try { @b@ jedis = jsentinelPool.getResource(); @b@ jedis.set("key", "aaa"); @b@ while(true){@b@ @b@ try { @b@ System.out.println(jedis.getClient().getHost()+":"+jedis.getClient().getPort()+"@"+jedis.get("key"));@b@ } catch (Exception e) {@b@ System.out.println("getConntion error,waiting 5s,will try again..."+e.getMessage());@b@ Thread.sleep(5000);@b@ try {@b@ jedis = jsentinelPool.getResource();@b@ } catch (Exception e1) {@b@ System.out.println("getResource error2,waiting more,will try again..."+e.getMessage());@b@ } @b@ } @b@ Thread.sleep(2000);@b@ }@b@ @b@ @b@ } catch (Exception e) { @b@ e.printStackTrace(); @b@ } finally { @b@ jedis.close(); @b@ } @b@ jsentinelPool.close(); @b@ } @b@ @b@@b@}
1. 分别kill -9 6379、6380redis服务器模拟其宕机情况,控制台打印日志如下
[root@centos6 redis]# ps -ef|grep redis@b@root 4570 1 0 06:15 ? 00:00:00 /usr/local/bin/redis-server *:6380 @b@root 4587 3809 0 06:17 pts/3 00:00:01 /usr/local/bin/redis-sentinel *:26379 [sentinel] @b@root 4591 3836 0 06:17 pts/1 00:00:01 /usr/local/bin/redis-sentinel *:26380 [sentinel] @b@root 4595 3859 0 06:17 pts/2 00:00:01 /usr/local/bin/redis-sentinel *:26381 [sentinel] @b@root 4764 1 0 06:27 ? 00:00:00 /usr/local/bin/redis-server *:6379 @b@root 4787 1 0 06:31 ? 00:00:00 /usr/local/bin/redis-server *:6381 @b@root 4792 3724 0 06:31 pts/0 00:00:00 grep redis@b@[root@centos6 redis]# kill -9 4764@b@[root@centos6 redis]# ps -ef|grep redis@b@root 4570 1 0 06:15 ? 00:00:00 /usr/local/bin/redis-server *:6380 @b@root 4587 3809 0 06:17 pts/3 00:00:01 /usr/local/bin/redis-sentinel *:26379 [sentinel] @b@root 4591 3836 0 06:17 pts/1 00:00:01 /usr/local/bin/redis-sentinel *:26380 [sentinel] @b@root 4595 3859 0 06:17 pts/2 00:00:01 /usr/local/bin/redis-sentinel *:26381 [sentinel] @b@root 4787 1 0 06:31 ? 00:00:00 /usr/local/bin/redis-server *:6381 @b@root 4803 3724 0 06:33 pts/0 00:00:00 grep redis@b@[root@centos6 redis]# kill -9 4570
四月 17, 2019 11:37:57 下午 redis.clients.jedis.JedisSentinelPool initSentinels@b@信息: Trying to find master from available Sentinels...@b@四月 17, 2019 11:37:57 下午 redis.clients.jedis.JedisSentinelPool initSentinels@b@信息: Redis master running at 192.168.1.202:6379, starting Sentinel listeners...@b@四月 17, 2019 11:37:57 下午 redis.clients.jedis.JedisSentinelPool initPool@b@信息: Created JedisPool to master at 192.168.1.202:6379@b@192.168.1.202:6379@aaa@b@192.168.1.202:6379@aaa@b@192.168.1.202:6379@aaa@b@192.168.1.202:6379@aaa@b@192.168.1.202:6379@aaa@b@192.168.1.202:6379@aaa@b@192.168.1.202:6379@aaa@b@192.168.1.202:6379@aaa@b@192.168.1.202:6379@aaa@b@192.168.1.202:6379@aaa@b@getConntion error,waiting 5s,will try again...It seems like server has closed the connection.@b@getResource error2,waiting more,will try again...It seems like server has closed the connection.@b@getConntion error,waiting 5s,will try again...java.net.SocketException: Software caused connection abort: socket write error@b@getResource error2,waiting more,will try again...java.net.SocketException: Software caused connection abort: socket write error@b@getConntion error,waiting 5s,will try again...java.net.SocketException: Software caused connection abort: socket write error@b@getResource error2,waiting more,will try again...java.net.SocketException: Software caused connection abort: socket write error@b@getConntion error,waiting 5s,will try again...java.net.SocketException: Software caused connection abort: socket write error@b@getResource error2,waiting more,will try again...java.net.SocketException: Software caused connection abort: socket write error@b@getConntion error,waiting 5s,will try again...java.net.SocketException: Software caused connection abort: socket write error@b@getResource error2,waiting more,will try again...java.net.SocketException: Software caused connection abort: socket write error@b@getConntion error,waiting 5s,will try again...java.net.SocketException: Software caused connection abort: socket write error@b@四月 17, 2019 11:38:59 下午 redis.clients.jedis.JedisSentinelPool initPool@b@信息: Created JedisPool to master at 192.168.1.202:6380@b@192.168.1.202:6380@aaa@b@192.168.1.202:6380@aaa@b@192.168.1.202:6380@aaa@b@192.168.1.202:6380@aaa@b@192.168.1.202:6380@aaa@b@192.168.1.202:6380@aaa@b@...@b@192.168.1.202:6380@aaa@b@getConntion error,waiting 5s,will try again...It seems like server has closed the connection.@b@getResource error2,waiting more,will try again...It seems like server has closed the connection.@b@getConntion error,waiting 5s,will try again...java.net.SocketException: Software caused connection abort: socket write error@b@getResource error2,waiting more,will try again...java.net.SocketException: Software caused connection abort: socket write error@b@getConntion error,waiting 5s,will try again...java.net.SocketException: Software caused connection abort: socket write error@b@getResource error2,waiting more,will try again...java.net.SocketException: Software caused connection abort: socket write error@b@getConntion error,waiting 5s,will try again...java.net.SocketException: Software caused connection abort: socket write error@b@getResource error2,waiting more,will try again...java.net.SocketException: Software caused connection abort: socket write error@b@getConntion error,waiting 5s,will try again...java.net.SocketException: Software caused connection abort: socket write error@b@getResource error2,waiting more,will try again...java.net.SocketException: Software caused connection abort: socket write error@b@getConntion error,waiting 5s,will try again...java.net.SocketException: Software caused connection abort: socket write error@b@四月 17, 2019 11:40:57 下午 redis.clients.jedis.JedisSentinelPool initPool@b@信息: Created JedisPool to master at 192.168.1.202:6381@b@192.168.1.202:6381@aaa@b@192.168.1.202:6381@aaa@b@192.168.1.202:6381@aaa@b@192.168.1.202:6381@aaa@b@192.168.1.202:6381@aaa@b@192.168.1.202:6381@aaa@b@192.168.1.202:6381@aaa@b@...
2. 三台哨兵服务器打印日志如下
[root@centos6 redis]# /usr/local/bin/redis-sentinel /etc/redis/sentinel26379.conf --protected-mode no@b@4587:X 16 Apr 06:17:12.365 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo@b@4587:X 16 Apr 06:17:12.365 # Redis version=4.0.2, bits=64, commit=00000000, modified=0, pid=4587, just started@b@4587:X 16 Apr 06:17:12.365 # Configuration loaded@b@4587:X 16 Apr 06:17:12.366 * Increased maximum number of open files to 10032 (it was originally set to 1024).@b@ _._ @b@ _.-''__ ''-._ @b@ _.-'' '. '_. ''-._ Redis 4.0.2 (00000000/0) 64 bit@b@ .-'' .-'''. '''\/ _.,_ ''-._ @b@ ( ' , .-' | ', ) Running in sentinel mode@b@ |'-._'-...-' __...-.''-._|'' _.-'| Port: 26379@b@ | '-._ '._ / _.-' | PID: 4587@b@ '-._ '-._ '-./ _.-' _.-' @b@ |'-._'-._ '-.__.-' _.-'_.-'| @b@ | '-._'-._ _.-'_.-' | http://redis.io @b@ '-._ '-._'-.__.-'_.-' _.-' @b@ |'-._'-._ '-.__.-' _.-'_.-'| @b@ | '-._'-._ _.-'_.-' | @b@ '-._ '-._'-.__.-'_.-' _.-' @b@ '-._ '-.__.-' _.-' @b@ '-._ _.-' @b@ '-.__.-' @b@@b@4587:X 16 Apr 06:17:12.366 # WARNING: The TCP backlog setting of 511 cannot be enforced because /proc/sys/net/core/somaxconn is set to the lower value of 128.@b@4587:X 16 Apr 06:17:12.366 # Sentinel ID is 3deef21eea5f4a5198f71236bd1d0fc859c28ff7@b@4587:X 16 Apr 06:17:12.366 # +monitor master mymaster 192.168.1.202 6379 quorum 1@b@4587:X 16 Apr 06:17:17.407 # +sdown sentinel a3b1a33e0d2dbe70b8de78dba808a1e0a6e6fc5c 192.168.1.202 26381 @ mymaster 192.168.1.202 6379@b@4587:X 16 Apr 06:17:18.020 # +new-epoch 2229@b@4587:X 16 Apr 06:17:19.634 # -sdown sentinel a3b1a33e0d2dbe70b8de78dba808a1e0a6e6fc5c 192.168.1.202 26381 @ mymaster 192.168.1.202 6379@b@4587:X 16 Apr 06:17:46.512 # +sdown master mymaster 192.168.1.202 6379@b@4587:X 16 Apr 06:17:46.512 # +odown master mymaster 192.168.1.202 6379 #quorum 1/1@b@4587:X 16 Apr 06:17:46.512 # +new-epoch 2230@b@4587:X 16 Apr 06:17:46.512 # +try-failover master mymaster 192.168.1.202 6379@b@4587:X 16 Apr 06:17:46.514 # +vote-for-leader 3deef21eea5f4a5198f71236bd1d0fc859c28ff7 2230@b@4587:X 16 Apr 06:17:46.514 # 3deef21eea5f4a5198f71236bd1d0fc859c28ff7 voted for 3deef21eea5f4a5198f71236bd1d0fc859c28ff7 2230@b@4587:X 16 Apr 06:17:46.538 # a3b1a33e0d2dbe70b8de78dba808a1e0a6e6fc5c voted for 3deef21eea5f4a5198f71236bd1d0fc859c28ff7 2230@b@4587:X 16 Apr 06:17:46.538 # 51df014024045d5382a408c4afe1f9c3287bd0e3 voted for 3deef21eea5f4a5198f71236bd1d0fc859c28ff7 2230@b@4587:X 16 Apr 06:17:46.585 # +elected-leader master mymaster 192.168.1.202 6379@b@4587:X 16 Apr 06:17:46.585 # +failover-state-select-slave master mymaster 192.168.1.202 6379@b@4587:X 16 Apr 06:17:46.657 # +selected-slave slave 192.168.1.202:6381 192.168.1.202 6381 @ mymaster 192.168.1.202 6379@b@4587:X 16 Apr 06:17:46.657 * +failover-state-send-slaveof-noone slave 192.168.1.202:6381 192.168.1.202 6381 @ mymaster 192.168.1.202 6379@b@4587:X 16 Apr 06:17:46.733 * +failover-state-wait-promotion slave 192.168.1.202:6381 192.168.1.202 6381 @ mymaster 192.168.1.202 6379@b@4587:X 16 Apr 06:17:47.631 # +promoted-slave slave 192.168.1.202:6381 192.168.1.202 6381 @ mymaster 192.168.1.202 6379@b@4587:X 16 Apr 06:17:47.631 # +failover-state-reconf-slaves master mymaster 192.168.1.202 6379@b@4587:X 16 Apr 06:17:47.669 * +slave-reconf-sent slave 192.168.1.202:6380 192.168.1.202 6380 @ mymaster 192.168.1.202 6379@b@4587:X 16 Apr 06:17:48.614 * +slave-reconf-inprog slave 192.168.1.202:6380 192.168.1.202 6380 @ mymaster 192.168.1.202 6379@b@4587:X 16 Apr 06:17:48.614 * +slave-reconf-done slave 192.168.1.202:6380 192.168.1.202 6380 @ mymaster 192.168.1.202 6379@b@4587:X 16 Apr 06:17:48.677 # +failover-end master mymaster 192.168.1.202 6379@b@4587:X 16 Apr 06:17:48.677 # +switch-master mymaster 192.168.1.202 6379 192.168.1.202 6381@b@4587:X 16 Apr 06:17:48.677 * +slave slave 192.168.1.202:6380 192.168.1.202 6380 @ mymaster 192.168.1.202 6381@b@4587:X 16 Apr 06:17:48.677 * +slave slave 192.168.1.202:6379 192.168.1.202 6379 @ mymaster 192.168.1.202 6381@b@4587:X 16 Apr 06:17:53.685 # +sdown slave 192.168.1.202:6379 192.168.1.202 6379 @ mymaster 192.168.1.202 6381@b@4587:X 16 Apr 06:18:56.920 # -sdown slave 192.168.1.202:6379 192.168.1.202 6379 @ mymaster 192.168.1.202 6381@b@4587:X 16 Apr 06:19:06.911 * +convert-to-slave slave 192.168.1.202:6379 192.168.1.202 6379 @ mymaster 192.168.1.202 6381@b@4587:X 16 Apr 06:22:19.373 # +new-epoch 2231@b@4587:X 16 Apr 06:22:19.376 # +vote-for-leader 51df014024045d5382a408c4afe1f9c3287bd0e3 2231@b@4587:X 16 Apr 06:22:19.456 # +sdown master mymaster 192.168.1.202 6381@b@4587:X 16 Apr 06:22:19.456 # +odown master mymaster 192.168.1.202 6381 #quorum 1/1@b@4587:X 16 Apr 06:22:19.456 # Next failover delay: I will not start a failover before Tue Apr 16 06:22:56 2019@b@4587:X 16 Apr 06:22:20.511 # +config-update-from sentinel 51df014024045d5382a408c4afe1f9c3287bd0e3 192.168.1.202 26380 @ mymaster 192.168.1.202 6381@b@4587:X 16 Apr 06:22:20.511 # +switch-master mymaster 192.168.1.202 6381 192.168.1.202 6379@b@4587:X 16 Apr 06:22:20.512 * +slave slave 192.168.1.202:6380 192.168.1.202 6380 @ mymaster 192.168.1.202 6379@b@4587:X 16 Apr 06:22:20.512 * +slave slave 192.168.1.202:6381 192.168.1.202 6381 @ mymaster 192.168.1.202 6379@b@4587:X 16 Apr 06:22:25.520 # +sdown slave 192.168.1.202:6381 192.168.1.202 6381 @ mymaster 192.168.1.202 6379@b@4587:X 16 Apr 06:24:02.550 # -sdown slave 192.168.1.202:6381 192.168.1.202 6381 @ mymaster 192.168.1.202 6379@b@4587:X 16 Apr 06:24:45.529 # +sdown master mymaster 192.168.1.202 6379@b@4587:X 16 Apr 06:24:45.529 # +odown master mymaster 192.168.1.202 6379 #quorum 1/1@b@4587:X 16 Apr 06:24:45.529 # +new-epoch 2232@b@4587:X 16 Apr 06:24:45.529 # +try-failover master mymaster 192.168.1.202 6379@b@4587:X 16 Apr 06:24:45.531 # +vote-for-leader 3deef21eea5f4a5198f71236bd1d0fc859c28ff7 2232@b@4587:X 16 Apr 06:24:45.531 # 3deef21eea5f4a5198f71236bd1d0fc859c28ff7 voted for 3deef21eea5f4a5198f71236bd1d0fc859c28ff7 2232@b@4587:X 16 Apr 06:24:45.536 # a3b1a33e0d2dbe70b8de78dba808a1e0a6e6fc5c voted for 3deef21eea5f4a5198f71236bd1d0fc859c28ff7 2232@b@4587:X 16 Apr 06:24:45.536 # 51df014024045d5382a408c4afe1f9c3287bd0e3 voted for 3deef21eea5f4a5198f71236bd1d0fc859c28ff7 2232@b@4587:X 16 Apr 06:24:45.593 # +elected-leader master mymaster 192.168.1.202 6379@b@4587:X 16 Apr 06:24:45.593 # +failover-state-select-slave master mymaster 192.168.1.202 6379@b@4587:X 16 Apr 06:24:45.649 # +selected-slave slave 192.168.1.202:6381 192.168.1.202 6381 @ mymaster 192.168.1.202 6379@b@4587:X 16 Apr 06:24:45.649 * +failover-state-send-slaveof-noone slave 192.168.1.202:6381 192.168.1.202 6381 @ mymaster 192.168.1.202 6379@b@4587:X 16 Apr 06:24:45.704 * +failover-state-wait-promotion slave 192.168.1.202:6381 192.168.1.202 6381 @ mymaster 192.168.1.202 6379@b@4587:X 16 Apr 06:24:45.796 # +promoted-slave slave 192.168.1.202:6381 192.168.1.202 6381 @ mymaster 192.168.1.202 6379@b@4587:X 16 Apr 06:24:45.796 # +failover-state-reconf-slaves master mymaster 192.168.1.202 6379@b@4587:X 16 Apr 06:24:45.877 * +slave-reconf-sent slave 192.168.1.202:6380 192.168.1.202 6380 @ mymaster 192.168.1.202 6379@b@4587:X 16 Apr 06:24:46.237 * +slave-reconf-inprog slave 192.168.1.202:6380 192.168.1.202 6380 @ mymaster 192.168.1.202 6379@b@4587:X 16 Apr 06:24:46.237 * +slave-reconf-done slave 192.168.1.202:6380 192.168.1.202 6380 @ mymaster 192.168.1.202 6379@b@4587:X 16 Apr 06:24:46.304 # +failover-end master mymaster 192.168.1.202 6379@b@4587:X 16 Apr 06:24:46.304 # +switch-master mymaster 192.168.1.202 6379 192.168.1.202 6381@b@4587:X 16 Apr 06:24:46.304 * +slave slave 192.168.1.202:6380 192.168.1.202 6380 @ mymaster 192.168.1.202 6381@b@4587:X 16 Apr 06:24:46.304 * +slave slave 192.168.1.202:6379 192.168.1.202 6379 @ mymaster 192.168.1.202 6381@b@4587:X 16 Apr 06:24:51.310 # +sdown slave 192.168.1.202:6379 192.168.1.202 6379 @ mymaster 192.168.1.202 6381@b@4587:X 16 Apr 06:27:32.660 # -sdown slave 192.168.1.202:6379 192.168.1.202 6379 @ mymaster 192.168.1.202 6381@b@4587:X 16 Apr 06:28:08.962 # +new-epoch 2233@b@4587:X 16 Apr 06:28:08.964 # +vote-for-leader a3b1a33e0d2dbe70b8de78dba808a1e0a6e6fc5c 2233@b@4587:X 16 Apr 06:28:09.054 # +sdown master mymaster 192.168.1.202 6381@b@4587:X 16 Apr 06:28:09.054 # +odown master mymaster 192.168.1.202 6381 #quorum 1/1@b@4587:X 16 Apr 06:28:09.054 # Next failover delay: I will not start a failover before Tue Apr 16 06:28:45 2019@b@4587:X 16 Apr 06:28:10.088 # +config-update-from sentinel a3b1a33e0d2dbe70b8de78dba808a1e0a6e6fc5c 192.168.1.202 26381 @ mymaster 192.168.1.202 6381@b@4587:X 16 Apr 06:28:10.088 # +switch-master mymaster 192.168.1.202 6381 192.168.1.202 6379@b@4587:X 16 Apr 06:28:10.088 * +slave slave 192.168.1.202:6380 192.168.1.202 6380 @ mymaster 192.168.1.202 6379@b@4587:X 16 Apr 06:28:10.088 * +slave slave 192.168.1.202:6381 192.168.1.202 6381 @ mymaster 192.168.1.202 6379@b@4587:X 16 Apr 06:28:15.112 # +sdown slave 192.168.1.202:6381 192.168.1.202 6381 @ mymaster 192.168.1.202 6379@b@4587:X 16 Apr 06:31:10.395 # -sdown slave 192.168.1.202:6381 192.168.1.202 6381 @ mymaster 192.168.1.202 6379@b@4587:X 16 Apr 06:31:49.008 # +sdown master mymaster 192.168.1.202 6379@b@4587:X 16 Apr 06:31:49.008 # +odown master mymaster 192.168.1.202 6379 #quorum 1/1@b@4587:X 16 Apr 06:31:49.008 # +new-epoch 2234@b@4587:X 16 Apr 06:31:49.008 # +try-failover master mymaster 192.168.1.202 6379@b@4587:X 16 Apr 06:31:49.025 # +vote-for-leader 3deef21eea5f4a5198f71236bd1d0fc859c28ff7 2234@b@4587:X 16 Apr 06:31:49.025 # 3deef21eea5f4a5198f71236bd1d0fc859c28ff7 voted for 3deef21eea5f4a5198f71236bd1d0fc859c28ff7 2234@b@4587:X 16 Apr 06:31:49.025 # a3b1a33e0d2dbe70b8de78dba808a1e0a6e6fc5c voted for a3b1a33e0d2dbe70b8de78dba808a1e0a6e6fc5c 2234@b@4587:X 16 Apr 06:31:49.025 # 51df014024045d5382a408c4afe1f9c3287bd0e3 voted for 51df014024045d5382a408c4afe1f9c3287bd0e3 2234@b@4587:X 16 Apr 06:31:59.568 # -failover-abort-not-elected master mymaster 192.168.1.202 6379@b@4587:X 16 Apr 06:31:59.635 # Next failover delay: I will not start a failover before Tue Apr 16 06:32:25 2019@b@4587:X 16 Apr 06:32:25.249 # +new-epoch 2235@b@4587:X 16 Apr 06:32:25.251 # +vote-for-leader a3b1a33e0d2dbe70b8de78dba808a1e0a6e6fc5c 2235@b@4587:X 16 Apr 06:32:25.261 # Next failover delay: I will not start a failover before Tue Apr 16 06:33:01 2019@b@4587:X 16 Apr 06:32:26.459 # +config-update-from sentinel a3b1a33e0d2dbe70b8de78dba808a1e0a6e6fc5c 192.168.1.202 26381 @ mymaster 192.168.1.202 6379@b@4587:X 16 Apr 06:32:26.459 # +switch-master mymaster 192.168.1.202 6379 192.168.1.202 6380@b@4587:X 16 Apr 06:32:26.459 * +slave slave 192.168.1.202:6381 192.168.1.202 6381 @ mymaster 192.168.1.202 6380@b@4587:X 16 Apr 06:32:26.459 * +slave slave 192.168.1.202:6379 192.168.1.202 6379 @ mymaster 192.168.1.202 6380@b@4587:X 16 Apr 06:32:31.490 # +sdown slave 192.168.1.202:6379 192.168.1.202 6379 @ mymaster 192.168.1.202 6380@b@4587:X 16 Apr 06:33:47.160 # +sdown master mymaster 192.168.1.202 6380@b@4587:X 16 Apr 06:33:47.160 # +odown master mymaster 192.168.1.202 6380 #quorum 1/1@b@4587:X 16 Apr 06:33:47.160 # +new-epoch 2236@b@4587:X 16 Apr 06:33:47.160 # +try-failover master mymaster 192.168.1.202 6380@b@4587:X 16 Apr 06:33:47.246 # +vote-for-leader 3deef21eea5f4a5198f71236bd1d0fc859c28ff7 2236@b@4587:X 16 Apr 06:33:47.247 # 3deef21eea5f4a5198f71236bd1d0fc859c28ff7 voted for 3deef21eea5f4a5198f71236bd1d0fc859c28ff7 2236@b@4587:X 16 Apr 06:33:47.247 # a3b1a33e0d2dbe70b8de78dba808a1e0a6e6fc5c voted for a3b1a33e0d2dbe70b8de78dba808a1e0a6e6fc5c 2236@b@4587:X 16 Apr 06:33:47.247 # 51df014024045d5382a408c4afe1f9c3287bd0e3 voted for 51df014024045d5382a408c4afe1f9c3287bd0e3 2236@b@4587:X 16 Apr 06:33:57.687 # -failover-abort-not-elected master mymaster 192.168.1.202 6380@b@4587:X 16 Apr 06:33:57.777 # Next failover delay: I will not start a failover before Tue Apr 16 06:34:23 2019@b@4587:X 16 Apr 06:34:23.255 # +new-epoch 2237@b@4587:X 16 Apr 06:34:23.258 # +vote-for-leader a3b1a33e0d2dbe70b8de78dba808a1e0a6e6fc5c 2237@b@4587:X 16 Apr 06:34:23.291 # Next failover delay: I will not start a failover before Tue Apr 16 06:35:00 2019@b@4587:X 16 Apr 06:34:23.704 # +config-update-from sentinel a3b1a33e0d2dbe70b8de78dba808a1e0a6e6fc5c 192.168.1.202 26381 @ mymaster 192.168.1.202 6380@b@4587:X 16 Apr 06:34:23.704 # +switch-master mymaster 192.168.1.202 6380 192.168.1.202 6381@b@4587:X 16 Apr 06:34:23.704 * +slave slave 192.168.1.202:6379 192.168.1.202 6379 @ mymaster 192.168.1.202 6381@b@4587:X 16 Apr 06:34:23.704 * +slave slave 192.168.1.202:6380 192.168.1.202 6380 @ mymaster 192.168.1.202 6381@b@4587:X 16 Apr 06:34:28.729 # +sdown slave 192.168.1.202:6380 192.168.1.202 6380 @ mymaster 192.168.1.202 6381@b@4587:X 16 Apr 06:34:28.729 # +sdown slave 192.168.1.202:6379 192.168.1.202 6379 @ mymaster 192.168.1.202 6381