title: How to build a simplified redis cluster (support data sharding and load balance)?
body: <p>Since the redis cluster is still a work in progress, I want to build a simplied one by myselfin the current stage. The system should support data sharding,load balance and master-slave backup. A preliminary plan is as follows:</p>
  
  <ol>
  <li><p>Master-slave: use multiple master-slave pairs in different locations to enhance the data security. Matsters are responsible for the write operation, while both masters and slaves can provide the read service. Datas are sent to all the masters during one write operation. Use Keepalived between the master and the slave to detect failures and switch master-slave automatically.</p></li>
  <li><p>Data sharding:  write a consistant hash on the client side to support data sharding during write/read in case the memory is not enougth in single machine.</p></li>
  <li><p>Load balance: use LVS to redirect the read request to the corresponding server for the load balance.</p></li>
  </ol>
  
  <p>My question is how to combine the LVS and the data sharding together? </p>
  
  <p>For example, because of data sharding, all keys are splited and stored in server A,B and C without overlap. Considering the slave backup and other master-slave pairs, the system will contain 1(A,B,C), 2(A,B,C) , 3(A,B,C) and so on, where each one has three servers. How to configure the LVS to support the redirection in such a situation when a read request comes? Or is there other approachs in redis to achieve the same goal? </p>
  
  <p>Thanks:)</p>