I have x cluster. This cluster look like

Cluster 1
192.168.1. (Server type 1)
192.168.2. (Server type 2)
192.168.3.1 (Server type 3) <Redis server> 

Cluster 2
192.167.1. (Server type 1)
192.167.2. (Server type 2)
192.167.3.1 (Server type 3) <Redis server> 

Currently I am managing cluster group configuration in code. Is it possible to have a domain called as using haproxy And which redirect require based on source ip? For example

192.167.* request gets redirect to 192.167.3.1

and

192.168.* request gets redirect to 192.168.3.1
share|improve this question
up vote 7 down vote accepted

This is possible with HAProxy ACLs. You need to setup 2 backends, one for each block, then in the frontend create 2 acls, one for each backend.

Your frontend block would look something like this

   acl block_7 src 192.167.0.0/16
   acl block_8 src 192.168.0.0/16

   use backend block_7_hosts if block_7 
   use backend block_8_hosts if block_8

Then define a backends block_7_hosts and block_8_hosts with the correct redis server in them.

If you don't plan on adding more Redis servers though you may just want to use a configuration management tool since you aren't really load balancing.

share|improve this answer
    
ya I want to do static routing and distribute load manually – Vivek Goel Apr 25 '13 at 15:52

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.