You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add a task to reset a MySQL slave by running `RESET SLAVE;` and
repointing the replication log to the last known position.
I found these steps very useful in recovering MySQL replication after
the VMs running master and slaves had been powered off in the new
Carrenza Production environment and replication was failing when the VMs
were turned back on. Specifically, the error I saw was that the slave
was 'NULL' seconds behind the MySQL master.
I've used `run()` in combination with `sudo -i` rather than `sudo()` so
that the `HOME` environment variable is set to `/root` so that
`/root/my.cnf` is picked up by the MySQL client so that it does not
prompt for a password.
I've used `run('sudo -i...')` rather than `run_mysql_command()` when
I've needed to grep for values.
I tried using a pure SQL query to retrieve the replication status.
`SELECT foo FROM information_schema.GLOBAL_STATUS;` didn't work because
neither the `information_schema` or `mysql` databases store the values
this task uses. I also tried `SHOW STATUS LIKE 'Slave_Running'`, but
couldn't find a way (even using subqueries) to pull out just the value I
needed.
0 commit comments