microsoftarchive / redis

Redis is an in-memory database that persists on disk. The data model is key-value, but many different kind of values are supported: Strings, Lists, Sets, Sorted Sets, Hashes
http://redis.io
Other
20.81k stars 5.37k forks source link

Redis master slave replication not working #439

Closed kksarathy closed 8 years ago

kksarathy commented 8 years ago

I configured redis instances in two machines. One as master, another as slave. When I start both the servers, I am seeing the following logs:

Slave:

[5160] 04 Apr 15:19:28.093 * Connecting to MASTER...

[5160] 04 Apr 15:19:28.093 * MASTER <-> SLAVE sync started 0 clients connected (0 slaves), 461204 bytes in use

[5160] 04 Apr 15:19:37.141 * Non blocking connect for SYNC fired the event.

[5160] 04 Apr 15:19:37.141 * Master replied to PING, replication can continue...

Master: [18832] 04 Apr 15:19:37.225 * Slave ask for synchronization

[18832] 04 Apr 15:19:37.227 * Starting BGSAVE for SYNC

[18832] 04 Apr 15:19:37.229 * Foreground saving ...

[18832] 04 Apr 15:19:37.236 * DB saved on disk

[18832] 04 Apr 15:19:37.238 * Foreground saving terminated with success

INFO Command in both Master and Slave gives the following outputs:

Master: Replication

role:master

connected_slaves:1

slave0:10.165.18.29,6379,wait_bgsave

Slave: Replication

role:slave

master_host:10.165.19.39

master_port:6379

master_link_status:down

master_last_io_seconds_ago:-1

master_sync_in_progress:1

master_sync_left_bytes:-1

master_sync_last_io_seconds_ago:6

master_link_down_since_seconds:261

slave_priority:100

slave_read_only:1

connected_slaves:0

Replication is not completed as the rdb file is not copied to the slave. I feel the process is struc in BGSAVE. Can someone Please help me to fix this issue. TIA

enricogior commented 8 years ago

Hi @kksarathy is this the same problem you reported in https://github.com/MSOpenTech/redis/issues/440? Thank you.

enricogior commented 8 years ago

I'm closing this issue, since it is a dup of #440.