简体   繁体   English

Redis | 复制和公用磁盘存储

[英]Redis | Replication and common disk storage

I am just starting to use Redis for the first time. 我刚开始第一次使用Redis。 I have gone through the documentation and I came to know that Redis can be used in replication mode. 我遍历了文档,才知道Redis可以在复制模式下使用。 But, I have some questions which are still un-answered. 但是,我有一些问题尚未解决。 Let's have a quick view of use-case 让我们快速了解用例

  • I have a clustered environment of Drupal 7 code base. 我有一个Drupal 7代码库的集群环境。
  • There are two web servers web1 and web2 and two DB servers DB1 and DB2 有两个Web服务器web1和web2,两个DB服务器DB1和DB2
  • DB1 and DB2 are running in master-slave mode DB1和DB2在主从模式下运行
  • I have to setup Redis on both web1 and web2, web1 as master and web2 as slave 我必须在web1和web2上都设置Redis,将web1设置为主服务器,将web2设置为从属服务器
  • I need same backend/disk storage for both master and slave 主服务器和从服务器都需要相同的后端/磁盘存储

Is it possible to setup same backend/disk storage for both master and slave? 是否可以为主服务器和从服务器设置相同的后端/磁盘存储? A solution can be that I use Redis on a single server, eg on web1. 一个解决方案可以是我在单个服务器(例如web1)上使用Redis。 In this case requests on web2 uses Redis cache of web1. 在这种情况下,Web2上的请求使用Web1的Redis缓存。 In this case I will get a delay by network. 在这种情况下,我会因网络而延迟。 I want to avoid this situation because I want to utilize full performance of Redis ie reading from the memory. 我想避免这种情况,因为我想利用Redis的全部性能,即从内存中读取。

Is there any other workaround? 还有其他解决方法吗?

If your master Redis instance is on Web1 then all writes will have to go here. 如果您的主Redis实例在Web1上,则所有写操作都必须在此处进行。 You can however read from the slave instance on Web2 locally. 但是,您可以在本地从Web2上的从属实例读取。

http://redis.io/topics/replication http://redis.io/topics/replication

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM