In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces MySQL galera cluster principle handout, hope to give you some knowledge to supplement and update, if there are other problems to understand, you can continue to pay attention to my updated article in the industry information.
characteristics
Full Parallel Synchronous Replication Based on Row Replication
Real-time multi-master architecture, any node can read and write
Latency-free replication, zero transaction loss, reliable and robust read and write experience.
Automatic node relationship control: node failure automatic removal, node join automatic coordination
Close to native MySQL database connection experience
2. application
PXC cluster of percona branch
MariaDB Cluster with Maria Branch
3. When a transaction is committed on the node currently being written, it is converted into a transaction via the wsrep API (write set replication API).
The write set is broadcast to other nodes in the same cluster. After receiving the write set transaction, other nodes check the feasibility of the transaction.
and returns the results to the wsrep API.
If most nodes estimate that they can successfully execute the transaction, the wsrep API arbitrates and notifies all nodes that can successfully execute the transaction.
The transaction node commits the transaction, and returns a message that the transaction was successfully submitted to the client. At the same time, it eliminates unsuccessful execution according to needs.
node of transaction
4. Galera Shared Library
galera itself is a plug-in shared library file, MySQL gets galera clusters by calling galera WriteSet Copy API hooks
Characteristics.
4.1 galera shared library components
galera library is a protocol stack that provides prepare, copy, and application write set transaction functions. Its important components are:
wsrep API: Writeset replication functional component, responsible for providing relational database management and replication services, defining interfaces
wsrep hooks: Integrated writeset components in the database engine
Gelera Provider: Converting shared libraries to wsrep API
Certification Layer: Protect writeset integrity, verify writeset integrity
replication: Manage replication protocols and provide a complete command system
GCS framework: Provides plug-in architecture for group communication
5. advantages
Compared to asynchronous replication:
Data consistency is strong, traditional asynchronous replication can not guarantee the consistency of master-slave data, this is because in general, the main library multi-thread concurrent execution
Transaction, but only one thread from the library to redo the transaction, in high pressure cases will inevitably lead to master-slave delay.
Compared to synchronous replication using semi-synchronous replication or distributed locks:
High performance and good scalability. Semi-synchronous replication is difficult to guarantee its performance under high load or even poor performance from the library. Even automatic
Switching from semi-synchronous replication to asynchronous replication also sacrifices its greatest benefit: consistency. It is also less friendly to expand
The unique advantages of galera clusters:
1. Each node in the cluster holds a complete copy of the data, and the data backup is highly secure
2. Cluster scalability is strong, and nodes can be added or removed adaptively:
When a new node comes online, you can either get full data transfer (SST) directly from the cluster in an empty state or restore the latest backup state from
State join cluster, acquire delta data transfer (IST)
When offline maintenance of one of the nodes, directly close the instance, the cluster will automatically kick out this node. After the maintenance is completed, it will be based on its own
How far the data lags behind the cluster data determines whether the data is transmitted via SST or IST.
3. High synchronization efficiency, providing high performance read and write state (as opposed to synchronous replication). Because of the synchronization mechanism, it can even
Further improve node synchronization efficiency by adding slave threads
4. More friendly software and hardware compatibility: MySQL's official NDB, although it can also achieve the same function, but due to higher requirements for software and hardware,
As a result, its usage is not on the same order of magnitude as galera cluster, which is easy to add nodes, but unable to remove nodes without downtime.
7. Disadvantages:
DDL operations can severely block synchronous threads, large actions on the line can lead to unresponsiveness, which can potentially lead to node congestion, and further can lead to
Some nodes are offline. In practice, it needs to be matched with online DDL tools such as pt-osc or gh-osc to operate DDL.
Read the above on MySQL galera cluster principle handout, I hope to give you some help in practical application. Due to the limited space of this article, it is inevitable that there will be deficiencies and needs to be supplemented. If you need more professional answers, you can contact our 24-hour pre-sales service on the official website to help you answer your questions at any time.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.