Skip to content

Commit

Permalink
Merge pull request #80 from spotahome/devops-819-add-configuration-to…
Browse files Browse the repository at this point in the history
…-persist-data

[DEVOPS-819] Add configuration to persist data
  • Loading branch information
jchanam authored Sep 3, 2018
2 parents 561b930 + a9b7bc3 commit bac9c2f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
VERSION := 0.5.0
VERSION := 0.5.1

# Name of this service/application
SERVICE_NAME := redis-operator
Expand Down
5 changes: 4 additions & 1 deletion operator/redisfailover/service/generator.go
Original file line number Diff line number Diff line change
Expand Up @@ -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`,
},
}
}
Expand All @@ -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`,
Expand Down

0 comments on commit bac9c2f

Please sign in to comment.