Location of a temporary Redis file for replication?

I tried setting up Master-Slave synchronization on a debian machine. I always get this error in my logs and I cannot figure out where the temp = / file should be

[9559] 31 Jul 11:48:17 * Connecting to MASTER... [9559] 31 Jul 11:48:17 * MASTER <-> SLAVE sync started [9559] 31 Jul 11:48:17 * Non blocking connect for SYNC fired the event. [9559] 31 Jul 11:48:22 # Opening the temp file needed for MASTER <-> SLAVE synchronization: Permission denied 

Hope you guys can help me :)

+6
source share
2 answers

Most likely, the user running the redis-server process does not have access to the working directory.

Check redis.conf (in most cases /etc/redis.conf ) and find the dir parameter (look for the "Working directory" to find it and the documents for it), make sure that the directory can be written to the user running redis-server .

+7
source

In fact, the file generated by the wizard at the time of SYNC is a regular snapshot file (i.e. an rdb file) written in the same place as any other rdb files.

This location is set in the Redis configuration file of the master instance - see the dir and dbfilename parameters.

For example, to dump in /data/redis/dump.rdb

 # The filename where to dump the DB dbfilename dump.rdb # The working directory. # # The DB will be written inside this directory, with the filename specified # above using the 'dbfilename' configuration directive. # # Also the Append Only File will be created inside this directory. # # Note that you must specify a directory here, not a file name. dir /data/redis 

Of course, the Redis user is started in order to have the appropriate access rights to this location.

Now, on the subordinate side, the dump file read from the main is copied to a temporary file, whose name is similar to temp-% d.% Ld.rdb (including timestamp and pid). The file is created in the working directory, which corresponds to the dir parameter in the configuration of the slave instance. Therefore, even if the RDB is not active on the slave side, the dir parameter must be set correctly and point to the directory with the appropriate access rights.

+6
source

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


All Articles