diff --git a/Makefile b/Makefile index 36936d9cb..4c9617560 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -VERSION := 0.5.0 +VERSION := 0.5.1 # Name of this service/application SERVICE_NAME := redis-operator diff --git a/operator/redisfailover/service/generator.go b/operator/redisfailover/service/generator.go index e59761d9e..fb86b9611 100644 --- a/operator/redisfailover/service/generator.go +++ b/operator/redisfailover/service/generator.go @@ -118,7 +118,9 @@ func generateRedisConfigMap(rf *redisfailoverv1alpha2.RedisFailover, labels map[ }, Data: map[string]string{ redisConfigFileName: `slaveof 127.0.0.1 6379 -tcp-keepalive 60`, +tcp-keepalive 60 +save 900 1 +save 300 10`, }, } } @@ -138,6 +140,7 @@ func generateRedisShutdownConfigMap(rf *redisfailoverv1alpha2.RedisFailover, lab }, Data: map[string]string{ "shutdown.sh": `master=$(redis-cli -h ${RFS_REDIS_SERVICE_HOST} -p ${RFS_REDIS_SERVICE_PORT_SENTINEL} --csv SENTINEL get-master-addr-by-name mymaster | tr ',' ' ' | tr -d '\"' |cut -d' ' -f1) +redis-cli SAVE if [[ $master == $(hostname -i) ]]; then redis-cli -h ${RFS_REDIS_SERVICE_HOST} -p ${RFS_REDIS_SERVICE_PORT_SENTINEL} SENTINEL failover mymaster fi`,