From 9d084093717b0414c66ed94a583790aa2fa380d7 Mon Sep 17 00:00:00 2001 From: Julio Chana Date: Thu, 30 Aug 2018 15:11:41 +0200 Subject: [PATCH 1/3] [DEVOPS-819] Add configuration to persist data --- operator/redisfailover/service/generator.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/operator/redisfailover/service/generator.go b/operator/redisfailover/service/generator.go index e59761d9e..98bb96b19 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`, }, } } @@ -139,6 +141,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) if [[ $master == $(hostname -i) ]]; then + redis-cli SAVE redis-cli -h ${RFS_REDIS_SERVICE_HOST} -p ${RFS_REDIS_SERVICE_PORT_SENTINEL} SENTINEL failover mymaster fi`, }, From 135e7dc97b007901c52207263b7260a884da6d03 Mon Sep 17 00:00:00 2001 From: Julio Chana Date: Thu, 30 Aug 2018 15:19:47 +0200 Subject: [PATCH 2/3] [DEVOPS-819] Save database always on shutdown --- operator/redisfailover/service/generator.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/operator/redisfailover/service/generator.go b/operator/redisfailover/service/generator.go index 98bb96b19..fb86b9611 100644 --- a/operator/redisfailover/service/generator.go +++ b/operator/redisfailover/service/generator.go @@ -140,8 +140,8 @@ 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 SAVE redis-cli -h ${RFS_REDIS_SERVICE_HOST} -p ${RFS_REDIS_SERVICE_PORT_SENTINEL} SENTINEL failover mymaster fi`, }, From a9b7bc3a6caae95aefe665bf76c3280e1e9b5dfc Mon Sep 17 00:00:00 2001 From: Julio Chana Date: Mon, 3 Sep 2018 10:17:56 +0200 Subject: [PATCH 3/3] [DEVOPS-819] Bump version to 0.5.1 --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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