In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-04 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)05/31 Report--
This article mainly introduces "what is MySQL semi-synchronous SLAVE". In daily operation, I believe many people have doubts about what MySQL semi-synchronous SLAVE is. The editor consulted all kinds of data and sorted out simple and easy-to-use methods of operation. I hope it will be helpful to answer the questions of "what is MySQL semi-synchronous SLAVE?" Next, please follow the editor to study!
Mysql semi-synchronous SLAVE, similar to DATAGUARD in ORACLE security mode (but not exactly)
Why is it semi-synchronous, because MYSQL only guarantees that "at least one" SLAVE will return after receiving the log?
Although not many people may use this thing (because of the high requirements of the network and the high stability of the machine), MYSQL makes up for the lack of functionality in this area.
A commit performed on the master side blocks before returning to the session
That performed the transaction until at least one slave acknowledges that it has received
And logged the events for the transaction.
Semisynchronous replication is implemented through an optional plugin component.
See Section 17.3.8, "Semisynchronous Replication".
Http://dev.mysql.com/doc/refman/5.5/en/replication-semisync.html
The slave acknowledges receipt of a transaction's events only after the events have been written to its relay log and flushed to disk.
Synchronization is successful only if SLAVE receives the log and writes it to RELAY-LOG and flushes it to disk.
If a timeout occurs without any slave having acknowledged the transaction, the master reverts to asynchronous replication
If a timeout occurs during log transfer, SLAVE will revert to asynchronous mode
Semisynchronous replication must be enabled on both the master and slave sides. If semisynchronous replication is disabled on the master, or enabled on the master but on no slaves, the master uses asynchronous replication
Semi-synchronous replication must be turned on at the same time in MASTER and SLAVE; otherwise, it is still asynchronous.
While the master is blocking (waiting for acknowledgment from a slave after having performed a commit), it does not return to the session that performed the transaction
MASTER does not return a response to SESSION's COMMIT request until SLAVE receives the log or times out
The rolled-back transaction is logged even though it has no effect for transactional tables because the modifications to the nontransactional tables cannot be rolled back and must be sent to slaves.
The rollback operation, even if it has no effect on the transaction table, is also recorded in the log, because the "modification" will not be rollable for the non-transaction table, so it must also be transferred to SLAVE.
For auto-commit statements; MASTER will be BLOCK resided at the end of each statement
# # several system variable settings
Rpl_semi_sync_master_enabled=1 # Open MASTER to support semisynchronous replication
Rpl_semi_sync_slave_enabled=1 # Open Slave to support semisynchronous replication
Rpl_semi_sync_master_timeout # timeout waiting for SLAVE; 1MS, default 10000MS
Rpl_semi_sync_master_wait_no_slave # if the SLAVE is DOWN before the timeout, do you want to wait until the timeout; open by default
# # several status variables
Rpl_semi_sync_master_status # check whether MASTER supports semisynchronous replication
Rpl_semi_sync_slave_status # check whether SLAVE supports semisynchronous replication
Rpl_semi_sync_master_clients # check to see how many semisynchronous slaves follow
How many transactions have been successfully transferred by Rpl_semi_sync_master_yes_tx #
Rpl_semi_sync_master_no_tx # how many transactions failed to transfer
At this point, the study of "what is MySQL semi-synchronous SLAVE" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!
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.