添加 Redis 从机是否会对主机发出阻塞调用?
看起来不应该(毕竟,启动一个新的从服务器会阻止主服务器处理请求),但我想确认这一点。
就上下文而言,我正在考虑将一个从属设备添加到托管大约 8GB 数据的主控设备,而无需磁盘同步*。
*从历史上看,数据丢失并不是一个问题。我们正在改变这一点,因此复制和持久性在一定程度上被“向后移植”。
It is unclear to me from the documentation on replication whether the SYNC command is blocking.
It seems like it shouldn't be (after all, spinning up a new slave would stop the master from serving requests), but I'd like confirmation of that.
For context, I'm looking at adding a slave to a master hosting about 8GB of data with no disk sync*.
*Historically, data loss has not been a concern. We're changing that, so replication and persistence are being "back ported" to a degree.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
主设备只会对来自从设备的 SYNC 请求执行 BGSAVE,因此这不是阻塞操作。
所以顺序是:
如果主服务器未配置为保存,它也可以工作,只是它会为主服务器生成一个 .rdb <-> 。从机同步。在 redis.conf 中没有配置“save”行的主实例中,BGSAVE 不会自动调用,但如果需要保存 .rdb 文件,用户仍然可以调用。
the master will just perform a BGSAVE on SYNC request from the slave, so it's not a blocking operation.
So the sequence is:
It also works if the master is not configured to save, simply it will produce an .rdb just for master <-> slave synchronization. In master instances configured without "save" lines in redis.conf BGSAVE is not called automatically, but can still be called by the user if there is the need to save an .rdb file.