tailieunhanh - MySQL High Availability- P4
MySQL High Availability- P4: A lot of research has been done on replication, but most of the resulting concepts are never put into production. In contrast, MySQL replication is widely deployed but has never been adequately explained. This book changes that. Things are explained here that were previously limited to people willing to read a lot of source code and spend a lot of time debugging it in production, including a few late-night sessions. | the timeout limit and acknowledge that the transaction has been properly written to disk. You can use the rpl-semi-sync-master-wait-no-slave OW OFF option to turn off this behavior in which case the master reverts to asynchronous replication if there are no connected slaves. Monitoring semisynchronous replication Both plug-ins install a number of status variables that allow you to monitor semisynchronous replication. We will cover the most interesting ones here for a complete list consult the online reference manual for semisynchronous replication. rpl_semi_sync_master_clients This status variable reports the number of connected slaves that support and have registered for semisynchronous replication. rpl_semi_sync_master_status The status of semisynchronous replication on the master is 1 if it is active and 0 if it is inactive either because it has not been enabled or because it was enabled but has reverted to asynchronous replication. rpl_semi_sync_slave_status The status of semisynchronous replication on the slave is 1 if active that is it has been enabled and the I O thread is running and 0 if it is inactive. You can read the values of these variables either using the SHOW STATUS command or through the information schema table GLOBAL_STATUS. If you want to use the values for other purposes the SHOW STATUS command is hard to use and a query as shown in Example 4-5 uses SELECT on the information schema to extract the value and store it in a user-defined variable. Example 4-5. Retrieving values using the information schema master SELECT Variable_value INTO @value - FROM - WHERE Variable_name Rpl_semi_sync_master_status Query OK 1 row affected sec Slave Promotion The procedures described so far work well when you have a master running that you can use to synchronize the standby and the slave before the switchover but what happens if the master dies all of a sudden Since replication has stopped in its tracks with all slaves .
đang nạp các trang xem trước