Redis写入主机从从机读取
我们想使用Redis将数据分发到远程服务器。
总部有一个主实例,我们子公司中有许多远程从实例连接到主实例。
我们的应用程序在我们的子公司中运行。 99% 的情况下,都会向从属实例发出只读请求。
但也存在修改数据的情况。这样的请求是针对主机发出的。
有没有办法确保在下一个读取请求之前将对主设备所做的更改复制到从设备?
We want to use Redis to distribute data to remote servers.
There is one master instance in the HQ and many remote slaves in our subsidiaries connected to the master.
Our applications are running in our subsidiaries. In 99% of the time there are read-only requests made to the slave instance.
But there is also the case of modifying data. Such a request is issued against the master.
Is there a way to ensure that the changes made to the master are replicated to the slave before the next read request?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我不确定是否有办法可以 100% 确保这一点,但您可能想检查您的 redis.conf 文件并找到以下内容:
听起来您希望将其设置为
no
。配置文件中的注释详细解释了该指令。I'm not sure if there is a way you can ensure this 100%, but you probably want to check in your redis.conf file and find this:
Sounds like you'd want that set to
no
. The comments in the config file explain more about this directive.