Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Configure Redis slave to stop saving data to file

Tags:

redis

dump

slave

Can I configure Redis slave to stop saving dumps? I have omitted all save instructions in config file but slave is still doing dumps.

like image 811
Sebastian Sito Avatar asked Apr 01 '12 13:04

Sebastian Sito


People also ask

What is Redis master-slave?

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 is replication offset in Redis?

It allows replica Redis instances to be exact copies of master instances. The replica will automatically reconnect to the master every time the link breaks, and will attempt to be an exact copy of it regardless of what happens to the master.

How do I use Redis replica?

Setting up Redis instance as a replica In order to configure the Redis instance as a replica, we can use the replicaof parameter and set the master node's IP and port to identify the master and enable communication. Once these configurations are complete, restart the Redis services in all your replica nodes.

What is Redis failover?

Automatic FailoverA Redis Enterprise cluster provides fault tolerance and resilience. In the case of a primary server or node outage, Redis Enterprise's self-healing process automatically detects the hardware failure, elects a replica as a replacement, and promotes that replica to become the new primary server.


1 Answers

So I assume you have checked in the configuration file of the slave that RDB is deactivated (all save lines commented out), and the slave has been restarted after the configuration file has been changed (so this configuration is active).

At this point the background dump operation of the slave is deactivated, but it does not prevent the slave to write a dump file. Actually, the slave has to write a dump file at startup time: this is how it retrieves the data from the master in bulk mode.

When the slave starts, it sends a SYNC request to the master:

  • The master starts accumulating Redis commands.
  • The master performs a background dump
  • The master sends the dump file to the slave in bulk mode
  • The slave reads the dump file from the master and write it to the disk
  • When it is complete, the slave loads the dump file from the disk
  • The slave starts processing Redis commands accumulated by the master
  • Eventually, the slave will catch up
  • The slave is in sync with the master

That's why you can find dump files on slave side even if RDB is deactivated for the slaves.

like image 53
Didier Spezia Avatar answered Sep 30 '22 17:09

Didier Spezia