This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# HOW REPLICATION WORKS | |
IO_THREAD connects to a master, reads binary log events from the master as they come in and just copies them over to a local log file called relay log. | |
SQL_THREAD reads events from a relay log stored locally on the replication slave and then applies them as fast as possible. | |
There could be two reasons for delay in replication: | |
1. IO_THREAD delay | |
2. SQL_THREAD deplay | |
# HOW TO INDENTIFY REPLICATION LAG |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- | |
-- To create the group | |
-- | |
-- Create a ro_group (readonly group) | |
CREATE ROLE ro_group; | |
-- Grant access to existing tables | |
GRANT USAGE ON SCHEMA public TO ro_group; |