Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Write on Slave redis db

Tags:

redis

I have a master redis server (S1) and I have 6 other servers. I want them to have local redis slaves, so any change on the redis master will be replicated to the slaves on each local server

Can I write on a slave and make this one update the master, and then the master will update the other slaves?

like image 529
Daniel Sibaja Avatar asked Nov 20 '15 14:11

Daniel Sibaja


People also ask

Can you write to Redis slave?

We can configure which mode to write and read from. It is recommend to serves writes through Redis Master and reads through Redis Slaves. Redis Master does replicate writes to one or more Redis Slaves. The master-slave replication is done asynchronously.

What is slave in Redis?

The Redis replication uses an asynchronous method to transfer data from master to slave. The slave periodically acknowledges the received data sent by the master node, and also the master node can have many slaves. Redis can support cascading replication, so the slave can be connected to another slave.

What if Redis master goes down?

When a master goes down in a Redis cluster, Redis will wait for node timeout to promote slave to master. There may be additional time taken for slave promotion to master. During the time master goes down to slave promotion to master, writes/reads, especially writes will fail.


1 Answers

You can disable read-only mode on a slave, but the writes to the slave will be ephemeral and discarded when the slave resynchronizes or is restarted.

Also this feature will possibly be dropped in the future.

See http://redis.io/topics/replication#read-only-slave

like image 118
thepirat000 Avatar answered Oct 11 '22 05:10

thepirat000