Set up a Redis slave to stop saving data to a file

Can I configure a Redis slave to stop dump dumping? I skipped all save commands in the configuration file, but the slave still dumps.

+6
source share
2 answers

So, I assume that you checked in the configuration file of the slave that the RDB was deactivated (all saved lines are commented out) and the slave was restarted after changing the configuration file (so that this configuration is active).

At this moment, the background reset operation of the slave is deactivated, but this does not prevent the slave from writing the dump file. In fact, the subordinate should write the dump file during startup: in this way, it extracts data from the master in bulk.

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

  • The wizard begins to accumulate Redis teams.
  • The wizard resets the background
  • Master sends the dump file to slave mode in bulk mode
  • The slave reads the dump file from the master and writes it to disk
  • When it is complete, the slave will load the dump file from disk
  • Slave begins processing Redis commands accumulated by the master
  • In the end, the subordinate will catch up
  • Slave synchronizes with master

This is why you can find dump files on the slave, even if RDB is deactivated for slaves.

+8
source

Good reading http://redis.io/topics/persistence

Redis has 2 types of persistence, you should also disable AOF:

File to add only

Pictures are not very durable. If Redis stops running on your computer, your power line crashes, or you accidentally kill -9 For example, the latest data written in Redis will be lost. Although this may not be a big problem for some applications, there are cases for complete longevity, and in these cases Radish was not a viable option. The append-only file is an alternative, fully reliable strategy for Redis. It became available in version 1.1.

You can enable AOF in the configuration file:

 appendonly yes 

From now on, every time Redis receives a command that modifies (for example, SET), it will add it to the AOF. When restarting, Redis will repeat AOF playback to restore the state.

0
source

Source: https://habr.com/ru/post/912174/


All Articles