Skip to content
This repository has been archived by the owner on Mar 8, 2023. It is now read-only.

Commit

Permalink
Merge pull request #16 from PWx21/master
Browse files Browse the repository at this point in the history
add ability to save snapshots of db
  • Loading branch information
dwerder committed Feb 26, 2015
2 parents f93e428 + f6a0931 commit 69eccbe
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
5 changes: 4 additions & 1 deletion manifests/server.pp
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@
# Configure Redis slave replication timeout
# [*repl_ping_slave_period*]
# Configure Redis replication ping slave period
# [*save*]
# Configure Redis save snapshotting. Example: [[900, 1], [300, 10]]. Default: []
#
define redis::server (
$redis_name = $name,
Expand Down Expand Up @@ -92,6 +94,7 @@
$slave_read_only = true,
$repl_timeout = 60,
$repl_ping_slave_period = 10,
$save = [],
) {

$redis_install_dir = $::redis::install::redis_install_dir
Expand Down Expand Up @@ -131,7 +134,7 @@
require => Class['redis::install'],
}
}

file { "${redis_dir}/redis_${redis_name}":
ensure => directory,
require => Class['redis::install'],
Expand Down
6 changes: 3 additions & 3 deletions templates/etc/redis.conf.erb
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,9 @@ databases <%= @redis_nr_dbs %>
#
# Note: you can disable saving at all commenting all the "save" lines.

#save 900 1
#save 300 10
#save 60 10000
<% @save.each do |seconds, changes| %>
save <%= seconds %> <%= changes %>
<% end %>

# Compress string objects using LZF when dump .rdb databases?
# For default that's set to 'yes' as it's almost always a win.
Expand Down

0 comments on commit 69eccbe

Please sign in to comment.