A exception of relationship between master and slave in Redis

32 views
Skip to first unread message

xu ran

unread,
May 30, 2018, 1:33:25 AM5/30/18
to Redis DB
Pattern of Redis cluster:
  1. one master
  2. one slave
  3. three sentinels
I deployed a Redis cluster in kubernetes with a workload called statefulsets. Every instance was deployed in a single pod.


When i stopped the process of redis-server or delete the pod which master or slave was in here, the mechanism of Redis failover started to process. After the failover processed successfully, i check the info of replication between master and slave.I found that correct information appeared in slave, because i saw that the relationship between master and slave. But, i noticed that there weren't any information of relationship in master instance when i executed the command "redis-cli info replication". I known that creating the relationship of replication between master and slave needs to execute command "slaveof" in slave. And i executed this command in slave. However,  there weren't any information of relationship in master instance.


So, my question are below:
  1. What's rely on the relationship of replication in master created?
  2. How to fix this problem? (Now, my approach is restarting master instance)

xu ran

unread,
May 30, 2018, 1:36:16 AM5/30/18
to Redis DB
Master conf:

daemonize no
pidfile /var/run/redis.pid
port 6379
tcp-backlog 511
bind 0.0.0.0
timeout 30
maxclients 10000
tcp-keepalive 60
loglevel debug
logfile ""
syslog-enabled yes
syslog-ident native-redis
databases 16
save 900 1
save 300 10
save 60 10000
stop-writes-on-bgsave-error yes
rdbcompression yes
rdbchecksum yes
dbfilename dump.rdb
dir "/redis-data"
slave-serve-stale-data yes
rename-command FLUSHALL ""
rename-command FLUSHDB ""
slave-read-only yes
repl-diskless-sync no
repl-diskless-sync-delay 5
repl-disable-tcp-nodelay no
repl-timeout 600
repl-ping-slave-period 10
repl-backlog-size 16mb
repl-backlog-ttl 3600
slave-priority 100
requirepass %redis-pass%
appendonly yes
appendfilename "appendonly.aof"
appendfsync everysec
no-appendfsync-on-rewrite yes
auto-aof-rewrite-percentage 100
auto-aof-rewrite-min-size 64mb
aof-load-truncated yes
lua-time-limit 5000
slowlog-log-slower-than 10000
slowlog-max-len 1024
latency-monitor-threshold 0
notify-keyspace-events ""
hash-max-ziplist-entries 512
hash-max-ziplist-value 64
list-max-ziplist-entries 512
list-max-ziplist-value 64
set-max-intset-entries 512
zset-max-ziplist-entries 128
zset-max-ziplist-value 64
hll-sparse-max-bytes 3000
activerehashing yes
client-output-buffer-limit normal 0 0 0
client-output-buffer-limit slave 256mb 64mb 60
client-output-buffer-limit pubsub 32mb 8mb 60
hz 10
aof-rewrite-incremental-fsync yes

xu ran

unread,
May 30, 2018, 1:36:48 AM5/30/18
to Redis DB
slave conf:
daemonize no
pidfile /var/run/redis.pid
port 6379
tcp-backlog 511
bind 0.0.0.0
timeout 30
maxclients 10000
tcp-keepalive 60
loglevel debug
logfile ""
syslog-enabled yes
syslog-ident native-redis
databases 16
save 900 1
save 300 10
save 60 10000
stop-writes-on-bgsave-error yes
rdbcompression yes
rdbchecksum yes
dbfilename dump.rdb
dir "/redis-data"
slaveof %master-ip% 6379
masterauth %redis-pass%
slave-announce-ip %slave_ip%
slave-announce-port 6379

xu ran

unread,
May 30, 2018, 1:37:10 AM5/30/18
to Redis DB
sentinel conf:
sentinel monitor mymaster %master% 6379 2
sentinel auth-pass mymaster %password%
sentinel down-after-milliseconds mymaster %down-failover-time%
sentinel failover-timeout mymaster 180000
sentinel parallel-syncs mymaster 1
bind 0.0.0.0
Reply all
Reply to author
Forward
0 new messages