Can't write to redis replica when clustered 3x3

Viewed 337

I'm trying to write ephemeral data to a writable replica as described here: https://redis.io/topics/replication but the set command does not work as expected. I get a MOVED error response instead of an indication of a successful operation.

127.0.0.1:7003> config get replica-read-only
1) "replica-read-only"
2) "no"
127.0.0.1:7003> set fov no
(error) MOVED 11406 127.0.0.1:7002
127.0.0.1:7003> CLUSTER NODES
893b71a4b5bc055716ea4fd00a0cc8e14217fbef 127.0.0.1:7004@17004 slave 056939847f8de84b38de49899705b36754224db4 0 1609879136396 1 connected
624e43e39957773fb8fff0dcec31ce88ce70a426 127.0.0.1:7003@17003 myself,slave db0c5d3d39f8fbe6c4b87936029fa559c8d00fa8 0 1609879135000 3 connected
fdf3304058ec19c808e180dbb232e81b7fa06aaf 127.0.0.1:7001@17001 master - 0 1609879137397 2 connected 5461-10922
37f2c5f352fb9cdf2d48ae349d19fc55512b3203 127.0.0.1:7005@17005 slave fdf3304058ec19c808e180dbb232e81b7fa06aaf 0 1609879136000 2 connected
db0c5d3d39f8fbe6c4b87936029fa559c8d00fa8 127.0.0.1:7002@17002 master - 0 1609879137598 3 connected 10923-16383
056939847f8de84b38de49899705b36754224db4 127.0.0.1:7000@17000 master - 0 1609879137000 1 connected 0-5460

Note that I'm on node 7003 which is a replica of 7002, but as you can see I get redirected to 7002 instead of allowing the write to add to the replica. I've configured a cluster as described by this https://redis.io/topics/cluster-tutorial except my redis.conf contains replica-read-only no, which I verified above.

This works in a non-clustered environment with a single primary and a single replica (6380 is a replica of 6379). Everything works as expected in this scenario.

127.0.0.1:6380>set fov yes
OK

Redis info:

127.0.0.1:7003> info 
# Server
redis_version:6.0.9
redis_git_sha1:00000000
redis_git_dirty:0
redis_build_id:f199357e1ee47dfb
redis_mode:cluster
os:Linux 4.4.0-34-generic x86_64
arch_bits:64
multiplexing_api:epoll
atomicvar_api:atomic-builtin
gcc_version:5.4.0
process_id:4486

Any help on how to get this to work in redis cluster would be greatly appreciated. Thanks!

0 Answers
Related