summaryrefslogtreecommitdiff
path: root/redis.conf
diff options
context:
space:
mode:
authorantirez <antirez@gmail.com>2012-03-20 17:32:48 +0100
committerantirez <antirez@gmail.com>2012-03-20 17:32:48 +0100
commitf3fd419fc95e78818f9eeef15eb2d2e5a60bfbbb (patch)
tree03e75d79523ef181aaf689de2ea4d0e78af73169 /redis.conf
parent7a0c72f34550c3811324464661f1b463ccfd362b (diff)
downloadredis-f3fd419fc95e78818f9eeef15eb2d2e5a60bfbbb.tar.gz
Support for read-only slaves. Semantical fixes.
This commit introduces support for read only slaves via redis.conf and CONFIG GET/SET commands. Also various semantical fixes are implemented here: 1) MULTI/EXEC with only read commands now work where the server is into a state where writes (or commands increasing memory usage) are not allowed. Before this patch everything inside a transaction would fail in this conditions. 2) Scripts just calling read-only commands will work against read only slaves, when the server is out of memory, or when persistence is into an error condition. Before the patch EVAL always failed in this condition.
Diffstat (limited to 'redis.conf')
-rw-r--r--redis.conf8
1 files changed, 8 insertions, 0 deletions
diff --git a/redis.conf b/redis.conf
index e03359963..8396a6a47 100644
--- a/redis.conf
+++ b/redis.conf
@@ -156,6 +156,14 @@ dir ./
#
slave-serve-stale-data yes
+# You can configure a slave instance to accept writes or not. Writing against
+# a slave instance may be useful to store some ephemeral data (because data
+# written on a slave will be easily deleted after resync with the master) but
+# may also cause problems if clients are writing to it for an error.
+#
+# Since Redis 2.6 by default slaves are read-only.
+slave-read-only yes
+
# Slaves send PINGs to server in a predefined interval. It's possible to change
# this interval with the repl_ping_slave_period option. The default value is 10
# seconds.