Hi,

There was a nice tutorial at
http://www.alexwilliams.ca/blog/2009/08/10/using-haproxy-for-mysql-failover-and-redundancy/

But instead of doing such complex things, please try if galera cluster
for mysql is suitable for you.

cheers
thomas

On 06/18/13 13:51, Nenad Merdanovic wrote:
> Hello,
>
> There is no nice way of doing this in HAproxy that would show you that
> the server is down (in the Web GUI for example). You can only check
> where the traffic is going using the socket or the Web GUI and if the
> failover occured you will see traffic going to the 'backup' server.
>
> If you are using a single HAproxy node you can just put rise 9999999 on
> the server line for the master and it would be enough.
>
> If not, your only hope is HAproxy 1.5-dev and using stick tables with peers:
>
> In your MySQL backend you would add:
>         stick-table type ip size 10k peers mylbs
>         stick on dst
>
> And add another section:
>
> peers mylbs
>         peer peer1 10.0.0.1:1234
>         peer peer2 10.0.0.2;1234
>       ...
>
> Cleanest way of doing this, as discussed with Willy, would be to create
> a health agent on each MySQL server that would be 'intelligent' and
> aware of what's going on. Then you would send checks to it instead of
> MySQL and it would reply depending on the current status. I will likely
> create one in the near future for my own needs, so will share it here.
>
> Hope this helps.
> On 06/18/2013 01:38 PM, Jayadevan M wrote:
>> Hello all,
>>
>>  
>>
>> I am using HAProxy for MYSQL failover. It is a MySQL master-slave
>> replication environment. When master is UP, all reads and writes go to
>> master. In case the master is down, reads and writes will go to the
>> slave. Once the master is down and HAProxy redirects all reads/writes to
>> the slave, we do not want any writes/reads to go to the master even if
>> it comes up automatically. We want to ensure that there will be some
>> kind of manual intervention before a master, once marked down, gets
>> requests again. Is this possible?
>>
>>  
>>
>>  
>>
>> Regards,
>>
>> Jayadevan
>>
>>  
>>
>>
>>
>> DISCLAIMER: "The information in this e-mail and any attachment is
>> intended only for the person to whom it is addressed and may contain
>> confidential and/or privileged material. If you have received this
>> e-mail in error, kindly contact the sender and destroy all copies of the
>> original communication. IBS makes no warranty, express or implied, nor
>> guarantees the accuracy, adequacy or completeness of the information
>> contained in this email or any attachment and is not liable for any
>> errors, defects, omissions, viruses or for resultant loss or damage, if
>> any, direct or indirect."
> Regards,


Reply via email to