Checking MySQL replication

From Wikitech
(Difference between revisions)
Jump to: navigation, search
m (Robot: Adding Category:How-To)
 
Line 24: Line 24:
  
 
[[Category:How-To]]
 
[[Category:How-To]]
 +
[[Category:MySQL]]

Latest revision as of 19:22, 29 October 2010

[edit] Checking replication delay

Look for the two system user accounts in the processlist. One is the control process, the other is the SQL worker process. The Time: field of the SQL worker process is the difference between the local system clock and the timestamp of the replication log entry that it is processing. If the clocks are synchronized, this is the replication delay in seconds.

mysql> show processlist \G
*************************** 2. row ***************************
     Id: 18736
   User: system user
   Host:
     db: NULL
Command: Connect
   Time: 5
  State: Waiting for master to send event
   Info: NULL
*************************** 3. row ***************************
     Id: 18737
   User: system user
   Host:
     db: jawiki
Command: Connect
   Time: 29
  State: Updating
   Info: UPDATE cur SET cur_counter = cur_counter + 1 WHERE cur_id = 97735
Personal tools
Namespaces

Variants
Actions
Navigation
Ops documentation
Wiki
Toolbox