D
D
d3ZORg2012-08-24 08:45:46
linux
d3ZORg, 2012-08-24 08:45:46

How to implement switching IP addresses?

The question is - you need to implement switching IP addresses for MySQL servers.
There are 3 servers. 1 main master, 2 and 3 are passive masters.
There are 2 IP addresses, one of them should move to server 2 when 1 server crashes, the second ip - to server 3.
In a normal state both these ip on 1 server.
After restoring the first one, do not move it back (that is, not automatically, but manually).
In which direction to dig?

Answer the question

In order to leave comments, you need to log in

4 answer(s)
D
dgeliko, 2012-08-24
@d3ZORg

Corosync and Heartbeat are out of the blue. Due to their functionality, they are too redundant for this and buggy. We used both in production, both gave out feints with their ears, thanks to which the projects fell out of the blue. At the moment, we use vrrpd for “floating” IP - look in its direction, it performs its function with a bang.

V
vimvim, 2012-08-24
@vimvim

Judging by the nature of the question, do you need to organize a MySQL server redundancy with the ability to transparently switch to backup servers for clients in case the main one fails? If so, then it is called MySQL Load Balancer.
In fact, for this task, you can get by with 1 IP address (visible to MySQL clients) which will be assigned to the Load Balancer instance, which in turn, accepting MySQL requests from clients, will redirect them (in proxy mode) to the appropriate MySQL Server.
In addition to forwarding requests, the task of Load Balancer will also be to periodically access MySQL servers and determine their status. If one of the servers (for example master ) fails, it will automatically be marked as offline and requests will be forwarded to the next one.
Here is some information on the subject: barkingiguana.com/2008/07/20/load-balanced-highly-available-mysql-on-ubuntu-804/

I
ivnik, 2012-08-24
@ivnik

Look towards corosync or heartbeat

P
Puma Thailand, 2012-08-27
@opium

You will have an extremely buggy scheme, since you will also need to change the configs in mysql, and this is in any case simple + if mysql gets confused about where a certain server desynchronization comes from.
The most correct way is to lay it in the application itself or implement it in mysql proxy
. You method is a method of certain death for the admin.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question