将Rails应用程序基础架构从一个托管区域一点一点地迁移到另一个托管区域(只有公共Internet连接它们)我需要将Redis实例从一侧迁移到另一侧。
我倾向于使用主从设置来确保没有丢失任何内容,而且我们没有任何停机时间,而不是转储数据(即使很小:只是队列)。
互联网说SSH是我的朋友。
Old1是托管主Redis服务器的旧服务器。 Redis必然会绑定服务器的专用网络IP。
New1是托管新Redis服务器的新服务器。
在New1上我设置了ssh隧道/端口转发:
ssh -L 7380:<private_old1_ip>:6379 username@old1.publicname.ex仍然在New1上我检查我可以连接到两个实例:
redis-cli -p 6379 redis-cli -p 7380在两个基地,信息都有效。
在New1:Redis上,通过redis-cli我设置了slave模式:
salveof localhost 7380
现在这里是关于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而Old1:Redis(通过隧道):
# Replication role:master connected_slaves:1 slave0:<private_old1_ip>,6379,online所以隧道已经启动并正常工作。 有足够的内存可用。 从站似乎在Old1侧连接(但与Old1 ip一起出现)。 从站表示主链路状态已关闭且同步未在进行中。
我错过了什么?
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.exStill on New1 I check that I can connect to both instances :
redis-cli -p 6379 redis-cli -p 7380In 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:0While Old1:Redis (through the tunnel still) :
# Replication role:master connected_slaves:1 slave0:<private_old1_ip>,6379,onlineSo 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 ?
最满意答案
事实上问题很简单。
日志目标设置为/ dev / null,因此/ var / log中没有出现任何内容
存储目录设置为./,显然与守护程序设置不兼容,并导致同步权限错误。
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.
更多推荐
发布评论