Auto slave promotion without any DBAs intervention using Orchestrator and ProxySQL. If you are looking for a HA solution without going for synchronous replication or Aws RDS then Orchestrator with ProxySQL is a great choice.
sukan August 02, 2019
In a typical production environment, setting up high availability is one of the most crucial tasks. Having said that most of the setups do not have a HA solution. This is because a traditional MySQL setup doesn’t have an inbuilt failover solution. Luckily we have few options to go for HA.
HA based on synchronous replication
Cluster based solution would always provide HA. MySQL Cluster, Galera Cluster, InnoDB Cluster compromises of 2 or more servers (nodes) which can act as a HA. There are setups where implementing cluster would bring a lot of issues like deadlocks, increased transaction time as data volume goes up. These setup would have higher transactions flowing between the nodes which would cause a negative performance impact .
HA based on asynchronous replication
For a traditional MySQL setups one can use a replication manager / load balancer with failover support and achieve high availability. MHA, orchestrator are some of the replication managers. Orchestrator has lot of support and advanced features comparted to MHA.
In this blog, let us see how we have achieved HA using Orchestrator and ProxySQL
Background of the setup
3 MySQL servers, 1 master and 2 replicas
3 servers running with Orchestrator/raft and ProxySQL
How orchestrator works?
Orchestrator has three different phases namely,
Discovery
Refactoring
Recovery
Discovery phase of orchestrator detects the topology and understands the configuration of backend servers. It reads the replication status, configuration and understands the topology.
Refactoring phase will take care of replication rules, it will understand the binary log ordinates, GTID position and it initiates a recovery process.
Recovery phase of orchestrator will pick the ideal candidate as a master and will apply the promotion rules such as disabling read_only mode and repointing the available replica’s beneath the newly promoted master server.
Broadcasting the topology changes
Orchestrator can successfully detect the master failure and promoted a new master. Now application has to identify the changes and send the traffic to the current master. We have few options to notify the application about the changes.
Miru IT Park, Vallankumaranvillai,
Nagercoil, Tamilnadu - 629 002.
Unit 303, Vanguard Rise,
5th Main, Konena Agrahara,
Old Airport Road, Bangalore - 560 017.
Call: +91 6383016411
Email: sales@mafiree.com