READONLY

Since 1.1.0Cluster

Syntax

READONLY
  • Flags: fast
  • ACL categories: @cluster, @fast
  • Arity: 1

Lets the connection read from this replica: read commands for the slots of its master are served here, instead of being answered with MOVED. Writes are still redirected. What a replica returns can be behind its master. READWRITE turns it off.

Examples

On a replica:

> GET user:7
(error) MOVED 2780 127.0.0.1:17621
> READONLY
OK
> GET user:7
"v"
> SET user:7 w
(error) MOVED 2780 127.0.0.1:17621