Hướng dẫn percona mysql router
MySQL
InnoDB Cluster is an Oracle High Availability solution that can be easily installed over MySQL to provide high availability with multi-master capabilities and automatic failover. In the previous post we presented the first component of InnoDB Cluster, group replication. Now we will go through the second component, MySQL Router. We will address MySQL Shell in a
final instalment of this three-part series. By then, you should have a good overview of the features offeed by MySQL InnoDB Cluster.
MySQL RouterThis component is responsible for distributing the traffic between members of the cluster. It is a proxy-like solution to hide cluster topology from applications, so applications don’t need to know which member of a cluster is the primary node and which are secondaries. The tool is capable of performing read/write splitting by exposing different interfaces. A common setup is to have one read-write interface and one read-only interface. This is default behavior that also exposes 2 similar interfaces to use x-protocol (i.e. used for CRUD operations and async calls). The read and write split is done using a concept of roles: Primary for writes and Secondary for read-only. This is analogous to how members of cluster are named. Additionally, each interface is exposed via a TCP port so applications only need to know the IP:port combination used for writes and the one used for reads. Then, MySQL Router will take care of connections to cluster members depending on the type of traffic to server. MySQL Router is a very simple tool, maybe too simple as it is a layer four load balance and lacks some of the advanced features that some of it’s competitors have (e.g.. ProxySQL). Here is a short list of the most important features of MySQL Router:
Algorithms used for routingAn important thing to mention is the routing_strategy algorithms that are available, as they are assigned by default depending on the routing mode:
Additional routing_strategy algorithms :
A sample configurationFor performance purposes it’s recommended to setup MySQL Router in the same place as the application, considering an instance per application server. Here you can see a sample configuration file auto-generated by
We are almost done now, only one post left. The final post is about our third component MySQL Shell, so please keep reading. You May Also LikePercona is synonymous with optimized MySQL performance. Watch our webinar on MySQL scaling and high availability for insight on how to make your database run faster and how to make it more optimized than before. Percona CEO Peter Zaitsev hosts the webinar. Percona XtraDB Cluster (PXC) is a high availability MySQL clustering solution. It is open source and has multi-master capabilities. Percona has integrated PXC with ProxySQL to further meet your high availability and clustering needs. Watch our webinar to learn more and click here to learn how to perform schema upgrades using PXC. |