When I tried to use Master-Slaver mode in my playground, info replication always show "master_link_status:down". And then I used docker logs redis to check what happened. The logs showed Failed trying to load the MASTER synchronization DB from disk at the end. I will show more logs latter.
My Environment:
Redis: 4.0.8 (I pull the origin image from hub.docker.com by docker pull redis:4.0.8)
Docker: I am using Docker for Windows latest version. so my platform is Windows 10.
Then I used this command to start a container :
docker run -d -it -p 6379:6379 --net bridge1 --ip 192.168.0.7 -v E:\redis\conf-1-6379\:/etc/redis/ -v E:\redis\data-1:/data --restart always --name redis1 redis:4.0.8 redis-server /etc/redis/redis.conf
after that I also ran that command twice again(changed necessary fields).
Soon I used my java code to test shard function on my redis of three. It works very well and data separate into three of them symmetrically.
But when used slaverof 192.168.0.7 6279 command to my second 'redis2' and the problem happeded.
I tried info replication to check master_link_status but it always down.
Then I use docker logs redis2 to check the logs: The end part of logs looks like this:
1:S 09 Mar 09:01:02.357 * Connecting to MASTER 192.168.0.7:6379
1:S 09 Mar 09:01:02.358 * MASTER <-> SLAVE sync started
1:S 09 Mar 09:01:02.358 * Non blocking connect for SYNC fired the event.
1:S 09 Mar 09:01:02.358 * Master replied to PING, replication can continue...
1:S 09 Mar 09:01:02.359 * Partial resynchronization not possible (no cached master)
1:S 09 Mar 09:01:02.362 * Full resync from master: 8afb7023799bc17a9c8ee02fa4f37c0a7c0575a6:350
1:S 09 Mar 09:01:02.419 * MASTER <-> SLAVE sync: receiving 176 bytes from master
1:S 09 Mar 09:01:02.422 * MASTER <-> SLAVE sync: Flushing old data
1:S 09 Mar 09:01:02.422 * MASTER <-> SLAVE sync: Loading DB in memory
1:S 09 Mar 09:01:02.422 # Failed trying to load the MASTER synchronization DB from disk
That is all. And I don't know how to solve it.
Maybe when it access my volume or disk cause some wrong? (I have try change the windows file permission, grands all but no use.)
Or redis in docker for windows could cause some error?
It seems not the data problem(only 176b ,so nearly impossible is client-output-buffer-limit problem.)
Maybe I need to change some settings in the redis.conf more?
Hope my message could helpful in a way. Thanks in advance.
Comment From: jonahharris
Seems like this can only happen, without a helpful log message, due to fopen failures in rdbLoad, where it's trying to open the RDB file created by the replication. Perhaps it's flush or permissions-related? I've created a PR (#4760) containing a more helpful message in this case. If you can, try it and update this issue with what you get.
Comment From: Jacksonary
same with you, do you have done?
Comment From: trannamtrung1st
I managed to make it works using:
repl-diskless-load on-empty-db
However, I'm not so sure about this behavior. Any explanation would be helpful. Thanks in advance.
Comment From: mashirozx
Same issue till 2022, redis 6.2. Works fine on Linux, or without volume mount on Windows.
Comment From: aistvan
Exactly the same issue still persist for me with the latest version of docker-desktop for windows. If I point to a directory with the volume, redis replica can't read synched data from disk. If I left the volume managed by Docker, everything works fine.
Logs from replica:
2023-12-18 15:14:58 1:S 18 Dec 2023 14:14:58.880 * MASTER <-> REPLICA sync started 2023-12-18 15:14:58 1:S 18 Dec 2023 14:14:58.881 * Non blocking connect for SYNC fired the event. 2023-12-18 15:14:58 1:S 18 Dec 2023 14:14:58.882 * Master replied to PING, replication can continue... 2023-12-18 15:14:58 1:S 18 Dec 2023 14:14:58.884 * Partial resynchronization not possible (no cached master) 2023-12-18 15:14:58 1:S 18 Dec 2023 14:14:58.886 * Full resync from master: 4c6219a552bc08d43d5353e3272e056fbafa3ba3:0 2023-12-18 15:14:58 1:S 18 Dec 2023 14:14:58.968 * MASTER <-> REPLICA sync: receiving 175 bytes from master to disk 2023-12-18 15:14:58 1:S 18 Dec 2023 14:14:58.970 * MASTER <-> REPLICA sync: Flushing old data 2023-12-18 15:14:58 1:S 18 Dec 2023 14:14:58.970 * MASTER <-> REPLICA sync: Loading DB in memory 2023-12-18 15:14:58 1:S 18 Dec 2023 14:14:58.980 # Failed trying to load the MASTER synchronization DB from disk 2023-12-18 15:14:58 1:S 18 Dec 2023 14:14:58.983 * Reconnecting to MASTER redis-master:6379 after failure
Docker -v Docker version 24.0.6, build ed223bc
Docker compose version Docker Compose version v2.23.0-desktop.1
Comment From: MatteoNDR
Had the same problem with the latest version of Docker Windows
v4.27.2
Was able to solve it by adding
repl-diskless-load on-empty-db
on my conf files
Comment From: 209115041
使用最新版本的 Docker Windows 时遇到了同样的问题
v4.27.2
可以通过添加来解决
空数据库上无盘加载
在我的配置文件中
Thank you for your answer. It's very helpful to me. Thank you again
Comment From: awaismehmood88
Same problem Using redis 7.0.10 on Kubernetes on Linux Storage Window SMB
config repl-diskless-load on-empty-db
FIXED PROBLEM