Frage

Migrating bit by bit a Rails app infrastructure from one hosting zone to another (with only public internet linking them) I need to migrate a Redis instance from one side to the other.

Rather than dumping the data (even small : just queues), I'd prefer to use a master-slave setup to ensure that nothing is lost and that we don't have any down time.

Internet says SSH is my friend.

Old1 is the old server hosting the primary Redis server. Redis there is bound to a private network IP of the server.

New1 is the new server hosting the new Redis server.

On New1 I setup the ssh tunnel / port forwarding :

ssh -L 7380:<private_old1_ip>:6379 username@old1.publicname.ex

Still on New1 I check that I can connect to both instances :

redis-cli -p 6379
redis-cli -p 7380

In both bases, info works.

On New1:Redis, through redis-cli I setup the slave mode :

salveof localhost 7380

Now here is what info says on New1:Redis :

# Replication
role:slave
master_host:localhost
master_port:7380
master_link_status:down
master_last_io_seconds_ago:-1
master_sync_in_progress:0
master_link_down_since_seconds:1399544048
slave_priority:100
slave_read_only:1
connected_slaves:0

While Old1:Redis (through the tunnel still) :

# Replication
role:master
connected_slaves:1
slave0:<private_old1_ip>,6379,online

So the tunnel is up, and working. There is plenty of memory available. The slave appears connected on Old1 side (but appears with the Old1 ip). The slave says master link status is down and that the sync is not in progress.

What am I missing ?

War es hilfreich?

Lösung

The problem was quite simple in fact.

The log destination was set to /dev/null so nothing was appearing in /var/log

The storage directory was set to ./ which obviously don't play well with daemon settings and was causing permissions errors on synchronisation.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top