Font Size: a A A

Research And Implementation Of MySQL High Availability System In IGMAS Data Center

Posted on:2020-01-12Degree:MasterType:Thesis
Country:ChinaCandidate:J YangFull Text:PDF
GTID:2428330602452125Subject:Computer Science and Technology
Abstract/Summary:PDF Full Text Request
The Beidou navigation satellite system is an important part of China's space infrastructure construction,while iGMAS provides safe,stable and reliable navigation data and product services to users around the Beidou system.MySQL is used as the storage solution for structured data in the iGMAS data center,and the role of the MySQL system directly determines the availability of the entire business system,therefore,improving the high availability of the MySQL system is self-evident and important for the construction of the entire iGMAS data center.However,due to the particularity of the services in the data center,the current Some existing high availability systems do not meet business needs.This particularity is mainly caused by the way the business system uses MySQL.The business system in the data center stores the metadata information of the business data into the database,and the metadata includes the information of the path of the data file,and then the business system through the metadata information to find the corresponding business data file to provide external data services,MySQL is equivalent to playing an index role,which causes the business system to write a large proportion of the database,and because the high concurrency of business system write metadata and the implementation of high-volume writes make it more difficult to achieve high availability of MySQL.Therefore,this thesis aims to design a more efficient high-availability system to achieve high availability of MySQL system,to reduce the unavailability of data center business systems.A complete replication environment is an important foundation for MySQL high availability systems.Open source high-availability systems,including MHA,do not have the ability to automatically build replication environments,but this thesis designs a directed acyclic graph data structure for the replication environment,and designs the replication environment configuration algorithm and legality detection algorithm on the data structure,and a Redisbased caching scheme.After many experiments and tests,it takes only 0.66 s to build a replication environment with 10 slave nodes using multi-threading scheme.Compared with the previous manual method,it takes several minutes,which not only greatly improves the construction efficiency,but also guarantees the reliability of the replication environment.The high availability of the MySQL system is mainly through rapid failover when the main node is abnormal.This thesis optimizes and improves the database instance health detection method adopted by the widely used open source framework MHA,and designs and implements the methods based on system table update and based on the detection algorithm of IO request time,a heuristic algorithm is proposed to dynamically and adaptively adjust the interval of polling detection,thereby further shortening the time for discovering database anomalies.After many experimental tests,the average time-consuming time of the anomaly detection algorithm based on the system table update is 6.010 s,the average time-consuming time of the detection algorithm based on the IO request time is only 4.546 s,which verifies that the latter heuristic algorithm has better performance,and can further reduce system unavailability.When an abnormality occurs in the database instance,the failover process is triggered to achieve the failover of the master node.This thesis designs and implements the failover algorithm in non-gtid mode and gtid mode respectively,and analyzes the data synchronization process in detail.The data anomaly is generated and the data consistency guarantee algorithm is designed and implemented.According to the characteristics of the algorithm for IO-intensive operation,an asynchronous coroutine solution is designed to improve the concurrency efficiency of data recovery.After many experiments,in the replication environment with 10 slave nodes,the average time taken to implement failover operation in multi-threaded concurrent scheme in non-gtid mode is 1.642 s,while the average time consumption of asynchronous coroutine scheme is only 1.288 s,which verifies that the asynchronous coroutine scheme has a good optimization effect,and can further reduce the system unavailability time while ensuring data consistency.Finally,through the above optimization,iGMAS meets the functional requirements and performance requirements of MySQL high availability,currently in use in the data center,improving the high availability of the entire data center business system.
Keywords/Search Tags:MySQL High Availability, Binary Log Replication, Heuristic Timed Polling Algorithm, MySQL Failover, Python Coroutine
PDF Full Text Request
Related items