Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DEVOPS-819] Add configuration to persist data #80

Merged
merged 3 commits into from
Sep 3, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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