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 # Don't execute START SLAVE.
34 # Set the timeout when waiting for slave threads to stop and
35 # start, respectively. See include/wait_for_slave_param.inc
38 # This script will fail if Last_SQL_Error or Last_IO_Error is
39 # nonempty. If you expect an error in the SQL thread, you should
40 # normally do this before you source include/rpl_reset.inc:
42 # --source include/wait_for_slave_sql_error.inc
43 # --source include/stop_slave_io.inc
46 --let $include_filename= rpl_reset.inc
47 --source include/begin_include_file.inc
56 --source include/rpl_sync.inc
61 --echo ---- Stop and reset all servers ----
63 --let $_rpl_server= $rpl_server_count
66 --let $rpl_connection_name= server_$_rpl_server
67 --source include/rpl_connection.inc
69 # Check if this server is configured to have a master
70 if (`SELECT SUBSTRING(
'$rpl_master_list', 1 + ($_rpl_server - 1) * $rpl_server_count_length, $rpl_server_count_length) !=
''`)
72 --source include/stop_slave.inc
80 if (!$rpl_no_start_slave)
82 --source include/rpl_start_slaves.inc
86 --let $include_filename= rpl_reset.inc
87 --source include/end_include_file.inc