3
# Reset all replication servers to a clean state:
6
# - stop all slaves (STOP SLAVE),
7
# - remove all binlogs and relay logs (RESET MASTER and RESET SLAVE),
8
# - start all slaves again (START SLAVE).
10
# It does not execute CHANGE MASTER, so the replication topology is
16
# [--let $rpl_only_running_threads= 1]
17
# [--let $rpl_debug= 1]
18
# [--let $slave_timeout= NUMBER]
19
# --source include/rpl_end.inc
22
# $rpl_only_running_threads
23
# If one or both of the IO and SQL threads is stopped, sync and
24
# stop only the threads that are running. See
25
# include/rpl_sync.inc and include/stop_slave.inc for details.
28
# See include/rpl_init.inc
31
# Set the timeout when waiting for slave threads to stop and
32
# start, respectively. See include/wait_for_slave_param.inc
35
# This script will fail if Last_SQL_Error or Last_IO_Error is
36
# nonempty. If you expect an error in the SQL thread, you should
37
# normally do this before you source include/rpl_reset.inc:
39
# --source include/wait_for_slave_sql_error.inc
40
# --source include/stop_slave_io.inc
43
--let $include_filename= rpl_reset.inc
44
--source include/begin_include_file.inc
53
--source include/rpl_sync.inc
58
--echo ---- Stop and reset all servers ----
60
--let $_rpl_server= $rpl_server_count
63
--let $rpl_connection_name= server_$_rpl_server
64
--source include/rpl_connection.inc
66
# Check if this server is configured to have a master
67
if (`SELECT SUBSTRING('$rpl_master_list', 1 + ($_rpl_server - 1) * $rpl_server_count_length, $rpl_server_count_length) != ''`)
69
--source include/stop_slave.inc
77
--source include/rpl_start_slaves.inc
80
--let $include_filename= rpl_reset.inc
81
--source include/end_include_file.inc