configuration is also very simple. Slave seems to be copied repeatedly (if there is a mistake, it is still returning to retry)
docker-compose
version: "3"
services:
redis-master:
image: redis:3.2.12-alpine
volumes:
- ./master/redis.conf:/usr/local/etc/redis/redis.conf
- ./master/data:/tmp
ports:
- 6455:6455
command: [ "redis-server", "/usr/local/etc/redis/redis.conf" ]
redis-slave:
image: redis:3.2.12-alpine
depends_on:
- redis-master
volumes:
- ./slave/redis.conf:/usr/local/etc/redis/redis.conf
- ./slave/data:/tmp
ports:
- 6458:6458
command: [ "redis-server", "/usr/local/etc/redis/redis.conf" ]
master/redis.conf
bind 0.0.0.0
protected-mode no
port 6455
tcp-backlog 511
timeout 0
tcp-keepalive 300
daemonize no
supervised no
pidfile /var/run/redis_6379.pid
loglevel notice
logfile ""
databases 16
save 900 1
save 300 10
save 60 10000
rdbcompression yes
rdbchecksum yes
dbfilename dump.rdb
dir /tmp
appendonly yes
appendfilename "data.aof"
slave/redis.conf
bind 0.0.0.0
protected-mode no
port 6458
tcp-backlog 511
timeout 0
tcp-keepalive 300
daemonize no
supervised no
pidfile /var/run/redis_6379.pid
loglevel notice
logfile ""
databases 16
save 900 1
save 300 10
save 60 10000
rdbcompression yes
rdbchecksum yes
dbfilename dump.rdb
dir /tmp
appendonly yes
appendfilename "data.aof"
slaveof redis-master 6455
result
17:C 26 Jul 08:00:11.973 * DB saved on disk
redis-master_1 | 17:C 26 Jul 08:00:11.974 * RDB: 0 MB of memory used by copy-on-write
redis-master_1 | 1:M 26 Jul 08:00:12.074 * Background saving terminated with success
redis-slave_1 | 1:S 26 Jul 08:00:12.075 * MASTER <-> SLAVE sync: receiving 77 bytes from master
redis-master_1 | 1:M 26 Jul 08:00:12.076 * Synchronization with slave 172.21.0.3:6458 succeeded
redis-slave_1 | 1:S 26 Jul 08:00:12.080 * MASTER <-> SLAVE sync: Flushing old data
redis-slave_1 | 1:S 26 Jul 08:00:12.080 * MASTER <-> SLAVE sync: Loading DB in memory
redis-slave_1 | 1:S 26 Jul 08:00:12.080 -sharp Failed trying to load the MASTER synchronization DB from disk
redis-master_1 | 1:M 26 Jul 08:00:12.081 -sharp Connection with slave 172.21.0.3:6458 lost.
Synchronize failed, Failed trying to load the MASTER synchronization DB from disk
, and then slave kept trying again and again. Has anyone ever encountered it?