2016-03-25 17:51:22 +01:00
|
|
|
connect master1,127.0.0.1,root,,,$SERVER_MYPORT_1;
|
2012-09-28 01:06:56 +02:00
|
|
|
drop database if exists db;
|
|
|
|
create database db;
|
2014-02-11 17:45:49 +01:00
|
|
|
create table db.this_will_not_be_replicated (i int) engine=MyISAM;
|
2012-09-28 01:06:56 +02:00
|
|
|
create table db.t1 (i int) engine=MyISAM;
|
2014-02-11 17:45:49 +01:00
|
|
|
create table db.t2 (i int) engine=MyISAM;
|
2016-03-25 17:51:22 +01:00
|
|
|
connect master2,127.0.0.1,root,,,$SERVER_MYPORT_2;
|
2012-09-28 01:06:56 +02:00
|
|
|
drop database if exists db;
|
|
|
|
create database db;
|
2014-02-11 17:45:49 +01:00
|
|
|
create table db.t3 (i int) engine=MyISAM;
|
2016-03-25 17:51:22 +01:00
|
|
|
connect slave,127.0.0.1,root,,,$SERVER_MYPORT_3;
|
2012-09-28 01:06:56 +02:00
|
|
|
change master 'master1' to
|
|
|
|
master_port=MYPORT_1,
|
|
|
|
master_host='127.0.0.1',
|
|
|
|
master_user='root';
|
|
|
|
start slave 'master1';
|
|
|
|
set default_master_connection = 'master1';
|
|
|
|
include/wait_for_slave_to_start.inc
|
|
|
|
set default_master_connection = 'master2';
|
|
|
|
change master 'master2' to
|
|
|
|
master_port=MYPORT_2,
|
|
|
|
master_host='127.0.0.1',
|
|
|
|
master_user='root';
|
|
|
|
set global sql_slave_skip_counter = 2;
|
|
|
|
select @@global.sql_slave_skip_counter;
|
|
|
|
@@global.sql_slave_skip_counter
|
|
|
|
2
|
|
|
|
select @@session.sql_slave_skip_counter;
|
|
|
|
@@session.sql_slave_skip_counter
|
|
|
|
2
|
|
|
|
set session sql_slave_skip_counter = 3;
|
|
|
|
select @@global.sql_slave_skip_counter;
|
|
|
|
@@global.sql_slave_skip_counter
|
|
|
|
3
|
|
|
|
select @@session.sql_slave_skip_counter;
|
|
|
|
@@session.sql_slave_skip_counter
|
|
|
|
3
|
|
|
|
set global sql_slave_skip_counter= default;
|
|
|
|
select @@global.sql_slave_skip_counter;
|
|
|
|
@@global.sql_slave_skip_counter
|
|
|
|
0
|
|
|
|
select @@session.sql_slave_skip_counter;
|
|
|
|
@@session.sql_slave_skip_counter
|
|
|
|
0
|
2014-02-11 17:45:49 +01:00
|
|
|
set global sql_slave_skip_counter= 4;
|
2012-09-28 01:06:56 +02:00
|
|
|
set default_master_connection = 'master1';
|
|
|
|
select @@session.sql_slave_skip_counter;
|
|
|
|
@@session.sql_slave_skip_counter
|
|
|
|
0
|
|
|
|
set default_master_connection = 'qqq';
|
|
|
|
select @@session.sql_slave_skip_counter;
|
|
|
|
@@session.sql_slave_skip_counter
|
|
|
|
0
|
|
|
|
Warnings:
|
|
|
|
Warning 1617 There is no master connection 'qqq'
|
|
|
|
set default_master_connection = 'master2';
|
|
|
|
select @@session.sql_slave_skip_counter;
|
|
|
|
@@session.sql_slave_skip_counter
|
2014-02-11 17:45:49 +01:00
|
|
|
4
|
2012-10-01 01:30:44 +02:00
|
|
|
select @@global.max_relay_log_size;
|
|
|
|
@@global.max_relay_log_size
|
|
|
|
1073741824
|
|
|
|
set global max_relay_log_size = 1*1024*1024;
|
|
|
|
select @@global.max_relay_log_size;
|
|
|
|
@@global.max_relay_log_size
|
|
|
|
1048576
|
|
|
|
select @@session.max_relay_log_size;
|
|
|
|
@@session.max_relay_log_size
|
|
|
|
1048576
|
|
|
|
set session max_relay_log_size = 3*1024*1024;
|
|
|
|
select @@global.max_relay_log_size;
|
|
|
|
@@global.max_relay_log_size
|
|
|
|
3145728
|
|
|
|
select @@session.max_relay_log_size;
|
|
|
|
@@session.max_relay_log_size
|
|
|
|
3145728
|
|
|
|
set global max_relay_log_size= default;
|
|
|
|
select @@global.max_relay_log_size;
|
|
|
|
@@global.max_relay_log_size
|
|
|
|
1073741824
|
|
|
|
select @@session.max_relay_log_size;
|
|
|
|
@@session.max_relay_log_size
|
|
|
|
1073741824
|
|
|
|
set global max_relay_log_size= 3*1024*1024;
|
|
|
|
set default_master_connection = 'master1';
|
|
|
|
select @@session.max_relay_log_size;
|
|
|
|
@@session.max_relay_log_size
|
|
|
|
1073741824
|
|
|
|
set default_master_connection = 'qqq';
|
|
|
|
select @@session.max_relay_log_size;
|
|
|
|
@@session.max_relay_log_size
|
|
|
|
0
|
|
|
|
Warnings:
|
|
|
|
Warning 1617 There is no master connection 'qqq'
|
|
|
|
set default_master_connection = 'master2';
|
|
|
|
select @@session.max_relay_log_size;
|
|
|
|
@@session.max_relay_log_size
|
|
|
|
3145728
|
|
|
|
set global max_binlog_size= 4*1024*1024;
|
|
|
|
select @@global.max_relay_log_size;
|
|
|
|
@@global.max_relay_log_size
|
|
|
|
3145728
|
2012-09-28 01:06:56 +02:00
|
|
|
start slave 'master2';
|
|
|
|
include/wait_for_slave_to_start.inc
|
|
|
|
set default_master_connection = '';
|
2016-03-25 17:51:22 +01:00
|
|
|
connection master2;
|
|
|
|
connection slave;
|
2012-09-28 01:06:56 +02:00
|
|
|
show tables in db;
|
|
|
|
Tables_in_db
|
|
|
|
t1
|
2014-02-11 17:45:49 +01:00
|
|
|
t2
|
|
|
|
t3
|
|
|
|
this_will_not_be_replicated
|
2012-09-28 01:06:56 +02:00
|
|
|
drop database db;
|
|
|
|
set global sql_slave_skip_counter = 0;
|
2012-10-01 01:30:44 +02:00
|
|
|
set global max_relay_log_size = 1073741824;
|
|
|
|
set global max_binlog_size = 1073741824;
|
2012-10-04 06:02:13 +02:00
|
|
|
include/reset_master_slave.inc
|
2016-03-25 17:51:22 +01:00
|
|
|
disconnect slave;
|
|
|
|
connection master1;
|
2012-09-28 01:06:56 +02:00
|
|
|
drop database db;
|
2012-10-04 06:02:13 +02:00
|
|
|
include/reset_master_slave.inc
|
2016-03-25 17:51:22 +01:00
|
|
|
disconnect master1;
|
|
|
|
connection master2;
|
2012-09-28 01:06:56 +02:00
|
|
|
drop database db;
|
2012-10-04 06:02:13 +02:00
|
|
|
include/reset_master_slave.inc
|
2016-03-25 17:51:22 +01:00
|
|
|
disconnect master2;
|