Quantcast
Channel: linuxadmin: Expanding Linux SysAdmin knowledge
Viewing all articles
Browse latest Browse all 17761

mysql failover clustering

$
0
0

[SOLVED]

Going to try out the solution where i install HAproxy on each webserver, then a MariaDB galera cluster, and then just use localhost in my webpages when connecting to sql. Sounds like a simple solution that would be solid.


This have been bugging me for a while, and i have not yet found any good way to do this.

Today i have 1 mysql server, and 2 apache webservers, both webservers are synced and load balanced so if one goes down, the load automatically goes to the other so nothing goes offline. I connect to the mysql using the ip address in my php scripts.

What i want is for the mysql to be redundant too, i however don't care about load balancing them. I want 2 mysql servers that are mirrored at all times, so it doesn't matter which i write/read to, then if one of them goes offline, the load just goes to the other and they will resync when it comes back online. This way both a mysql and a webserver can go down without anything going offline.

But how do i do this? i know about clustering and replication in mysql, but how do i make my scripts failover to the other in case of a failure? i know i can use mysql_proxy or HAproxy for this, but then i have a single-point-of-failure on that instead, which is what i am trying to eliminate. I want to be able to poweroff 50% of my server, without anything going offline, and if the HAproxy happens to be in those 50% then i'm backup at having just one mysql would be the same.

I guess that something like this: http://www.clusterdb.com/mysql/replication-and-auto-failover-made-easy-with-mysql-utilities where you have master-slave replication with auto promotion of the slave in case the master goes offline is something really useful, but how do i make my scripts failover to the slave server in case the master goes offline??

submitted by _dev_random_
[link][30 comments]

Viewing all articles
Browse latest Browse all 17761

Trending Articles