ElastiCache slave-promote
Measurement script
#!/bin/bash
while :
do
sleep 1
date
timeout 2 redis-cli -h <ElastiCache Primary Endpoint> set hoge h-imaoka
done
Result
# | score |
---|---|
1 | 10 sec |
2 | 3 sec |
3 | 10 sec |
4 | 1 sec |
Endpoint's ttl = 15 sec, so within it.
But this score does not contail chancel multi-AZ ops
.
Why sentinel can not elect new master?
Erase /etc/redis-sentinel.conf
part auto generated.
I pass it only sentinel.conf
, it nothing to do with redis.conf
.
What will happen - sentinel -
save
at Master-node
Maybe failover
happen
bgsave
at Master-node
No failover
Can I use unpromoted slave (slave -> slave) as RO immediately?
No.
start A: Master, B: Slave, C: Slave
failover A: Failed , B: Master, C: Slave
Of cource, you can use B
as a master
immediately, but C
is not. When failover, C
state=wait_bgsave
. In wait_bgsave
, we can get key-values before failover happend time.
Untill C's state=online
, can not get new key-values created after failover (write at new master B
).
Restart master redis-daemon with RDB
No failover
(@600MB memory size)
But slave status will be wait_bgsave
Restart master redis-daemon without RDB
No failover
.
Just all data cleanup !
nutcracker
performance
redis-raw: 9,2k
nutcracker: 8.2k
elb : 7.1k