You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

27 lines
805 B

  1. #
  2. # now setup replication to continue from last epoch
  3. # 1. get ndb_apply_status epoch from slave
  4. # 2. get corresponding _next_ binlog postition from master
  5. # 3. change master on slave
  6. # 1.
  7. --connection slave
  8. --replace_column 1 <the_epoch>
  9. SELECT @the_epoch:=MAX(epoch) FROM mysql.ndb_apply_status;
  10. --let $the_epoch= `select @the_epoch`
  11. # 2.
  12. --connection master
  13. --replace_result $the_epoch <the_epoch>
  14. --replace_column 1 <the_pos>
  15. eval SELECT @the_pos:=Position,@the_file:=SUBSTRING_INDEX(FILE, '/', -1)
  16. FROM mysql.ndb_binlog_index WHERE epoch > $the_epoch ORDER BY epoch ASC LIMIT 1;
  17. --let $the_pos= `SELECT @the_pos`
  18. --let $the_file= `SELECT @the_file`
  19. # 3.
  20. --connection slave
  21. --replace_result $the_pos <the_pos>
  22. eval CHANGE MASTER TO
  23. master_log_file = '$the_file',
  24. master_log_pos = $the_pos ;