le1t0-deprec 2.1.6.075 → 2.1.6.076
Sign up to get free protection for your applications and to get access to all the features.
data/lib/deprec/recipes/redis.rb
CHANGED
@@ -5,10 +5,11 @@ Capistrano::Configuration.instance(:must_exist).load do
|
|
5
5
|
|
6
6
|
set :redis_user, 'redis'
|
7
7
|
set :redis_group, 'redis'
|
8
|
+
set :redis_ports, [6379]
|
8
9
|
|
9
10
|
SRC_PACKAGES[:redis] = {
|
10
|
-
:md5sum => '
|
11
|
-
:url => "http://redis.googlecode.com/files/redis-2.
|
11
|
+
:md5sum => '1c5b0d961da84a8f9b44a328b438549e redis-2.2.2.tar.gz',
|
12
|
+
:url => "http://redis.googlecode.com/files/redis-2.2.2.tar.gz",
|
12
13
|
:configure => nil,
|
13
14
|
}
|
14
15
|
|
@@ -22,12 +23,12 @@ Capistrano::Configuration.instance(:must_exist).load do
|
|
22
23
|
SYSTEM_CONFIG_FILES[:redis] = [
|
23
24
|
|
24
25
|
{:template => "redis-init.erb",
|
25
|
-
:path => '/etc/init.d/
|
26
|
+
:path => '/etc/init.d/redis_@@PORT@@',
|
26
27
|
:mode => 0755,
|
27
28
|
:owner => 'root:root'},
|
28
29
|
|
29
30
|
{:template => "redis-conf.erb",
|
30
|
-
:path => '/etc/redis/
|
31
|
+
:path => '/etc/redis/redis_@@PORT@@.conf',
|
31
32
|
:mode => 0755,
|
32
33
|
:owner => 'root:root'}
|
33
34
|
|
@@ -40,14 +41,24 @@ Capistrano::Configuration.instance(:must_exist).load do
|
|
40
41
|
The can be pushed to the server with the :config task.
|
41
42
|
DESC
|
42
43
|
task :config_gen do
|
43
|
-
|
44
|
-
|
44
|
+
redis_ports.each do |port|
|
45
|
+
SYSTEM_CONFIG_FILES[:redis].each do |file|
|
46
|
+
file_settings = file.dup
|
47
|
+
file_settings[:path].gsub!(/@@PORT@@/, port)
|
48
|
+
deprec2.render_template(:redis, file_settings)
|
49
|
+
end
|
45
50
|
end
|
46
51
|
end
|
47
52
|
|
48
53
|
desc "Push redis config files to server"
|
49
54
|
task :config, :roles => :redis do
|
50
|
-
|
55
|
+
redis_ports.each do |port|
|
56
|
+
SYSTEM_CONFIG_FILES[:redis].each do |file|
|
57
|
+
file_settings = file.dup
|
58
|
+
file_settings[:path].gsub!(/@@PORT@@/, port)
|
59
|
+
deprec2.push_configs(:redis, [file_settings])
|
60
|
+
end
|
61
|
+
end
|
51
62
|
end
|
52
63
|
|
53
64
|
task :create_redis_user, :roles => :redis do
|
@@ -18,16 +18,23 @@ daemonize yes
|
|
18
18
|
|
19
19
|
# When running daemonized, Redis writes a pid file in /var/run/redis.pid by
|
20
20
|
# default. You can specify a custom pid file location here.
|
21
|
-
pidfile /var/run/
|
21
|
+
pidfile /var/run/redis_<%= redis_port %>.pid
|
22
22
|
|
23
|
-
# Accept connections on the specified port, default is 6379
|
24
|
-
port
|
23
|
+
# Accept connections on the specified port, default is 6379.
|
24
|
+
# If port 0 is specified Redis will not listen on a TCP socket.
|
25
|
+
port <%= redis_port %>
|
25
26
|
|
26
27
|
# If you want you can bind a single interface, if the bind option is not
|
27
28
|
# specified all the interfaces will listen for incoming connections.
|
28
29
|
#
|
29
30
|
# bind 127.0.0.1
|
30
31
|
|
32
|
+
# Specify the path for the unix socket that will be used to listen for
|
33
|
+
# incoming connections. There is no default, so Redis will not listen
|
34
|
+
# on a unix socket when not specified.
|
35
|
+
#
|
36
|
+
# unixsocket /tmp/redis.sock
|
37
|
+
|
31
38
|
# Close the connection after a client is idle for N seconds (0 to disable)
|
32
39
|
timeout 300
|
33
40
|
|
@@ -44,6 +51,16 @@ loglevel verbose
|
|
44
51
|
# output for logging but daemonize, logs will be sent to /dev/null
|
45
52
|
logfile stdout
|
46
53
|
|
54
|
+
# To enable logging to the system logger, just set 'syslog-enabled' to yes,
|
55
|
+
# and optionally update the other syslog parameters to suit your needs.
|
56
|
+
# syslog-enabled no
|
57
|
+
|
58
|
+
# Specify the syslog identity.
|
59
|
+
# syslog-ident redis
|
60
|
+
|
61
|
+
# Specify the syslog facility. Must be USER or between LOCAL0-LOCAL7.
|
62
|
+
# syslog-facility local0
|
63
|
+
|
47
64
|
# Set the number of databases. The default database is DB 0, you can select
|
48
65
|
# a different one on a per-connection basis using SELECT <dbid> where
|
49
66
|
# dbid is a number between 0 and 'databases'-1
|
@@ -104,6 +121,19 @@ dir ./
|
|
104
121
|
#
|
105
122
|
# masterauth <master-password>
|
106
123
|
|
124
|
+
# When a slave lost the connection with the master, or when the replication
|
125
|
+
# is still in progress, the slave can act in two different ways:
|
126
|
+
#
|
127
|
+
# 1) if slave-serve-stale-data is set to 'yes' (the default) the slave will
|
128
|
+
# still reply to client requests, possibly with out of data data, or the
|
129
|
+
# data set may just be empty if this is the first synchronization.
|
130
|
+
#
|
131
|
+
# 2) if slave-serve-stale data is set to 'no' the slave will reply with
|
132
|
+
# an error "SYNC with master in progress" to all the kind of commands
|
133
|
+
# but to INFO and SLAVEOF.
|
134
|
+
#
|
135
|
+
slave-serve-stale-data yes
|
136
|
+
|
107
137
|
################################## SECURITY ###################################
|
108
138
|
|
109
139
|
# Require clients to issue AUTH <PASSWORD> before processing any other
|
@@ -119,6 +149,22 @@ dir ./
|
|
119
149
|
#
|
120
150
|
# requirepass foobared
|
121
151
|
|
152
|
+
# Command renaming.
|
153
|
+
#
|
154
|
+
# It is possilbe to change the name of dangerous commands in a shared
|
155
|
+
# environment. For instance the CONFIG command may be renamed into something
|
156
|
+
# of hard to guess so that it will be still available for internal-use
|
157
|
+
# tools but not available for general clients.
|
158
|
+
#
|
159
|
+
# Example:
|
160
|
+
#
|
161
|
+
# rename-command CONFIG b840fc02d524045429941cc15f59e41cb7be6c52
|
162
|
+
#
|
163
|
+
# It is also possilbe to completely kill a command renaming it into
|
164
|
+
# an empty string:
|
165
|
+
#
|
166
|
+
# rename-command CONFIG ""
|
167
|
+
|
122
168
|
################################### LIMITS ####################################
|
123
169
|
|
124
170
|
# Set the max number of connected clients at the same time. By default there
|
@@ -148,6 +194,37 @@ dir ./
|
|
148
194
|
#
|
149
195
|
# maxmemory <bytes>
|
150
196
|
|
197
|
+
# MAXMEMORY POLICY: how Redis will select what to remove when maxmemory
|
198
|
+
# is reached? You can select among five behavior:
|
199
|
+
#
|
200
|
+
# volatile-lru -> remove the key with an expire set using an LRU algorithm
|
201
|
+
# allkeys-lru -> remove any key accordingly to the LRU algorithm
|
202
|
+
# volatile-random -> remove a random key with an expire set
|
203
|
+
# allkeys->random -> remove a random key, any key
|
204
|
+
# volatile-ttl -> remove the key with the nearest expire time (minor TTL)
|
205
|
+
# noeviction -> don't expire at all, just return an error on write operations
|
206
|
+
#
|
207
|
+
# Note: with all the kind of policies, Redis will return an error on write
|
208
|
+
# operations, when there are not suitable keys for eviction.
|
209
|
+
#
|
210
|
+
# At the date of writing this commands are: set setnx setex append
|
211
|
+
# incr decr rpush lpush rpushx lpushx linsert lset rpoplpush sadd
|
212
|
+
# sinter sinterstore sunion sunionstore sdiff sdiffstore zadd zincrby
|
213
|
+
# zunionstore zinterstore hset hsetnx hmset hincrby incrby decrby
|
214
|
+
# getset mset msetnx exec sort
|
215
|
+
#
|
216
|
+
# The default is:
|
217
|
+
#
|
218
|
+
# maxmemory-policy volatile-lru
|
219
|
+
|
220
|
+
# LRU and minimal TTL algorithms are not precise algorithms but approximated
|
221
|
+
# algorithms (in order to save memory), so you can select as well the sample
|
222
|
+
# size to check. For instance for default Redis will check three keys and
|
223
|
+
# pick the one that was used less recently, you can change the sample size
|
224
|
+
# using the following configuration directive.
|
225
|
+
#
|
226
|
+
# maxmemory-samples 3
|
227
|
+
|
151
228
|
############################## APPEND ONLY MODE ###############################
|
152
229
|
|
153
230
|
# By default Redis asynchronously dumps the dataset on disk. If you can live
|
@@ -195,6 +272,26 @@ appendonly no
|
|
195
272
|
appendfsync everysec
|
196
273
|
# appendfsync no
|
197
274
|
|
275
|
+
# When the AOF fsync policy is set to always or everysec, and a background
|
276
|
+
# saving process (a background save or AOF log background rewriting) is
|
277
|
+
# performing a lot of I/O against the disk, in some Linux configurations
|
278
|
+
# Redis may block too long on the fsync() call. Note that there is no fix for
|
279
|
+
# this currently, as even performing fsync in a different thread will block
|
280
|
+
# our synchronous write(2) call.
|
281
|
+
#
|
282
|
+
# In order to mitigate this problem it's possible to use the following option
|
283
|
+
# that will prevent fsync() from being called in the main process while a
|
284
|
+
# BGSAVE or BGREWRITEAOF is in progress.
|
285
|
+
#
|
286
|
+
# This means that while another child is saving the durability of Redis is
|
287
|
+
# the same as "appendfsync none", that in pratical terms means that it is
|
288
|
+
# possible to lost up to 30 seconds of log in the worst scenario (with the
|
289
|
+
# default Linux settings).
|
290
|
+
#
|
291
|
+
# If you have latency problems turn this to "yes". Otherwise leave it as
|
292
|
+
# "no" that is the safest pick from the point of view of durability.
|
293
|
+
no-appendfsync-on-rewrite no
|
294
|
+
|
198
295
|
################################ VIRTUAL MEMORY ###############################
|
199
296
|
|
200
297
|
# Virtual Memory allows Redis to work with datasets bigger than the actual
|
@@ -269,17 +366,25 @@ vm-max-threads 4
|
|
269
366
|
|
270
367
|
############################### ADVANCED CONFIG ###############################
|
271
368
|
|
272
|
-
# Glue small output buffers together in order to send small replies in a
|
273
|
-
# single TCP packet. Uses a bit more CPU but most of the times it is a win
|
274
|
-
# in terms of number of queries per second. Use 'yes' if unsure.
|
275
|
-
glueoutputbuf yes
|
276
|
-
|
277
369
|
# Hashes are encoded in a special way (much more memory efficient) when they
|
278
370
|
# have at max a given numer of elements, and the biggest element does not
|
279
371
|
# exceed a given threshold. You can configure this limits with the following
|
280
372
|
# configuration directives.
|
281
|
-
hash-max-zipmap-entries
|
282
|
-
hash-max-zipmap-value
|
373
|
+
hash-max-zipmap-entries 512
|
374
|
+
hash-max-zipmap-value 64
|
375
|
+
|
376
|
+
# Similarly to hashes, small lists are also encoded in a special way in order
|
377
|
+
# to save a lot of space. The special representation is only used when
|
378
|
+
# you are under the following limits:
|
379
|
+
list-max-ziplist-entries 512
|
380
|
+
list-max-ziplist-value 64
|
381
|
+
|
382
|
+
# Sets have a special encoding in just one case: when a set is composed
|
383
|
+
# of just strings that happens to be integers in radix 10 in the range
|
384
|
+
# of 64 bit signed integers.
|
385
|
+
# The following configuration setting sets the limit in the size of the
|
386
|
+
# set in order to use this special memory saving encoding.
|
387
|
+
set-max-intset-entries 512
|
283
388
|
|
284
389
|
# Active rehashing uses 1 millisecond every 100 milliseconds of CPU time in
|
285
390
|
# order to help rehashing the main Redis hash table (the one mapping top-level
|
@@ -309,4 +414,4 @@ activerehashing yes
|
|
309
414
|
# other files, so use this wisely.
|
310
415
|
#
|
311
416
|
# include /path/to/local.conf
|
312
|
-
# include /path/to/other.conf
|
417
|
+
# include /path/to/other.conf
|
@@ -2,10 +2,10 @@
|
|
2
2
|
|
3
3
|
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
|
4
4
|
DAEMON=/usr/local/bin/redis-server
|
5
|
-
DAEMON_ARGS=/etc/redis/
|
5
|
+
DAEMON_ARGS=/etc/redis/redis_<%= redis_port %>.conf
|
6
6
|
NAME=redis-server
|
7
7
|
DESC=redis-server
|
8
|
-
PIDFILE=/var/run/
|
8
|
+
PIDFILE=/var/run/redis_<%= redis_port %>.pid
|
9
9
|
USER=<%= redis_user %>
|
10
10
|
GROUP=<%= redis_group %>
|
11
11
|
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: le1t0-deprec
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 2.1.6.
|
5
|
+
version: 2.1.6.076
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Le1t0
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2011-03-
|
13
|
+
date: 2011-03-22 00:00:00 +01:00
|
14
14
|
default_executable: depify
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|