Answer the question
In order to leave comments, you need to log in
haproxy and server enumeration
Hello dear community.
I ran into a wall with a question, is there a haproxy - how to set up balancing in it so that requests emulate failover?
Let me explain:
there are srv1, srv2 and srv3. By default, we work with srv1, but as soon as srv1 is down, we start working with srv2, and so on. I don't understand how to set it up.
Answer the question
In order to leave comments, you need to log in
In principle, here haproxy.1wt.eu/download/1.3/doc/architecture.txt is described in the second paragraph. In short, you must use keepalived , which allows you to have one shared IP for all servers. This shared IP will be associated with one specific server at a particular moment.
Maybe I misunderstood, but heartbeat / keepalived are used to reduce the failure of a single entry point, in this case haproxy. That is, we make shared IP on 2 servers with haproxy. One is working, the other is waiting. The first one crashes, heartbeat redirects IP to the second one and starts haproxy.
In the case of balancing:
in the backend, you can specify which servers are active, which are for backup. Check is enabled for them. Further haproxy will destroy.
That is, you can make 2 main, 2 for backup. Requests for backup will go only when all the main ones are dead.
Unfortunately, I did not set up chains like srv1->srv2->srv3. Can you give an example of
why application server failover is needed?
Actually, I figured out the backup topic, thanks :)
We have a master-master cluster of 4 Percona nodes. Since we have few records in the database, we use master-master as a failover in case one of the servers physically crashes (this happens quite often, cheap hardware). So there is a desire to simply redirect the record in case of a node-to-record fall, to the next one.
Actually, with backup, there is only one question, in case of a node-to-write fall, will it start writing roundrobin to the rest of the nodes? I would like to minimize the possibility of split-brain.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question