Skip to content

Commit

Permalink
Merge pull request #344 from brianbianco/fix_redis_24
Browse files Browse the repository at this point in the history
Fix Redis 2.4.x config
  • Loading branch information
shortdudey123 authored May 10, 2017
2 parents 3e5cec0 + 7cd21a9 commit 57d0c05
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
4 changes: 4 additions & 0 deletions .kitchen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,13 @@ suites:
- name: redis-package
run_list:
- recipe[redisio::default]
- recipe[redisio::install]
- recipe[redisio::disable_os_default]
- recipe[redisio::configure]
- recipe[redisio::enable]
attributes:
redisio:
bypass_setup: true
servers:
- port: 6379
package_install: true
Expand Down
2 changes: 0 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,3 @@ matrix:
allow_failures:
# https://github.com/brianbianco/redisio/issues/335
- env: CMD="kitchen verify" OPTIONS="redis-package-centos-6"
# https://github.com/brianbianco/redisio/issues/336
- env: CMD="kitchen verify" OPTIONS="redis-package-debian-7"
14 changes: 14 additions & 0 deletions templates/default/redis.conf.erb
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ protected-mode <%= @protected_mode %>
# Close the connection after a client is idle for N seconds (0 to disable)
<%= "timeout #{@timeout}" %>

<% if (@version[:major].to_i == 2 && @version[:minor].to_i >= 8) || @version[:major].to_i >= 3 %>
# TCP keepalive.
#
# If non-zero, use SO_KEEPALIVE to send TCP ACKs to clients in absence
Expand All @@ -98,6 +99,7 @@ protected-mode <%= @protected_mode %>
#
# A reasonable value for this option is 60 seconds.
tcp-keepalive <%=@keepalive%>
<% end %>

# Set server verbosity to 'debug'
# it can be one of:
Expand Down Expand Up @@ -160,6 +162,7 @@ databases <%=@databases%>
<% end %>
<% end %>

<% if (@version[:major].to_i == 2 && @version[:minor].to_i >= 6) || @version[:major].to_i >= 3 %>
# By default Redis will stop accepting writes if RDB snapshots are enabled
# (at least one save point) and the latest background save failed.
# This will make the user aware (in a hard way) that data is not persisting
Expand All @@ -174,6 +177,7 @@ databases <%=@databases%>
# continue to work as usual even if there are problems with disk,
# permissions, and so forth.
stop-writes-on-bgsave-error <%= @stopwritesonbgsaveerror %>
<% 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 Expand Up @@ -301,6 +305,7 @@ repl-timeout <%=@repltimeout%>
repl-disable-tcp-nodelay <%= @repldisabletcpnodelay %>
<% end %>

<% if (@version[:major].to_i == 2 && @version[:minor].to_i >= 8) || @version[:major].to_i >= 3 %>
# Set the replication backlog size. The backlog is a buffer that accumulates
# slave data when slaves are disconnected for some time, so that when a slave
# wants to reconnect again, often a full resync is not needed, but a partial
Expand All @@ -322,7 +327,9 @@ repl-backlog-size <%= @replbacklogsize %>
# A value of 0 means to never release the backlog.
#
repl-backlog-ttl <%= @replbacklogttl %>
<% end %>

<% if (@version[:major].to_i == 2 && @version[:minor].to_i >= 6) || @version[:major].to_i >= 3 %>
# The slave priority is an integer number published by Redis in the INFO output.
# It is used by Redis Sentinel in order to select a slave to promote into a
# master if the master is no longer working correctly.
Expand All @@ -337,6 +344,7 @@ repl-backlog-ttl <%= @replbacklogttl %>
#
# By default the priority is 100.
slave-priority <%= @slavepriority %>
<% end %>

<% if @version[:major].to_i >= 3 %>
# It is possible for a master to stop accepting writes if there are less than
Expand Down Expand Up @@ -629,6 +637,7 @@ auto-aof-rewrite-min-size <%=@aofrewriteminsize%>
aof-load-truncated <%= @aofloadtruncated %>
<% end %>

<% if (@version[:major].to_i == 2 && @version[:minor].to_i >= 6) || @version[:major].to_i >= 3 %>
################################ LUA SCRIPTING ###############################

# Max execution time of a Lua script in milliseconds.
Expand All @@ -646,6 +655,7 @@ aof-load-truncated <%= @aofloadtruncated %>
#
# Set it to 0 or a negative value for unlimited execution without warnings.
lua-time-limit <%= @luatimelimit %>
<% end %>

################################## SLOW LOG ###################################

Expand Down Expand Up @@ -873,6 +883,7 @@ activerehashing <%= @activerehasing %>
hash-max-zipmap-value 64
<% end %>
<% if (@version[:major].to_i == 2 && @version[:minor].to_i >= 6) || @version[:major].to_i >= 3 %>
# The client output buffer limits can be used to force disconnection of clients
# that are not reading data from the server fast enough for some reason (a
# common reason is that a Pub/Sub client can't consume messages as fast as the
Expand Down Expand Up @@ -914,7 +925,9 @@ activerehashing <%= @activerehasing %>
<% @clientoutputbufferlimit.each do |c| %>
<%= "client-output-buffer-limit #{c.flatten.join(' ')}" %>
<% end %>
<% end %>
<% if (@version[:major].to_i == 2 && @version[:minor].to_i >= 8) || @version[:major].to_i >= 3 %>
# Redis calls an internal function to perform many background tasks, like
# closing connections of clients in timeout, purging expired keys that are
# never requested, and so forth.
Expand All @@ -937,6 +950,7 @@ hz <%= @hz %>
# in order to commit the file to the disk more incrementally and avoid
# big latency spikes.
aof-rewrite-incremental-fsync <%= @aofrewriteincrementalfsync %>
<% end %>
<%if @clusterenabled == 'yes' %>
cluster-enabled yes
Expand Down

0 comments on commit 57d0c05

Please sign in to comment.