@@ -9,15 +9,36 @@ master_user='root';
9
9
start slave 'master1';
10
10
set default_master_connection = 'master1';
11
11
include/wait_for_slave_to_start.inc
12
- show slave 'master1' status;
13
- Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert Last_IO_Errno Last_IO_Error Last_SQL_Errno Last_SQL_Error Replicate_Ignore_Server_Ids Master_Server_Id Master_SSL_Crl Master_SSL_Crlpath Using_Gtid Gtid_IO_Pos
14
- Waiting for master to send event 127.0.0.1 root MYPORT_1 60 master-bin.000001 313 mysqld-relay-bin-master1.000002 601 master-bin.000001 Yes Yes 0 0 313 907 None 0 No 0 No 0 0 1 No
15
- show slave status;
16
- Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert Last_IO_Errno Last_IO_Error Last_SQL_Errno Last_SQL_Error Replicate_Ignore_Server_Ids Master_Server_Id Master_SSL_Crl Master_SSL_Crlpath Using_Gtid Gtid_IO_Pos
17
- Waiting for master to send event 127.0.0.1 root MYPORT_1 60 master-bin.000001 313 mysqld-relay-bin-master1.000002 601 master-bin.000001 Yes Yes 0 0 313 907 None 0 No 0 No 0 0 1 No
18
- show all slaves status;
19
- Connection_name Slave_SQL_State Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert Last_IO_Errno Last_IO_Error Last_SQL_Errno Last_SQL_Error Replicate_Ignore_Server_Ids Master_Server_Id Master_SSL_Crl Master_SSL_Crlpath Using_Gtid Gtid_IO_Pos Retried_transactions Max_relay_log_size Executed_log_entries Slave_received_heartbeats Slave_heartbeat_period Gtid_Slave_Pos
20
- master1 Slave has read all relay log; waiting for the slave I/O thread to update it Waiting for master to send event 127.0.0.1 root MYPORT_1 60 master-bin.000001 313 mysqld-relay-bin-master1.000002 601 master-bin.000001 Yes Yes 0 0 313 907 None 0 No 0 No 0 0 1 No 0 1073741824 7 0 60.000
12
+ #
13
+ # Checking SHOW SLAVE 'master1' STATUS
14
+ #
15
+ Master_Port = 'MYPORT_1'
16
+ Relay_Log_File = 'mysqld-relay-bin-master1.000002'
17
+ Slave_IO_Running = 'Yes'
18
+ Slave_SQL_Running = 'Yes'
19
+ Last_Errno = '0'
20
+ Last_SQL_Errno = '0'
21
+ #
22
+ # Checking SHOW SLAVE STATUS
23
+ #
24
+ Master_Port = 'MYPORT_1'
25
+ Relay_Log_File = 'mysqld-relay-bin-master1.000002'
26
+ Slave_IO_Running = 'Yes'
27
+ Slave_SQL_Running = 'Yes'
28
+ Last_Errno = '0'
29
+ Last_SQL_Errno = '0'
30
+ #
31
+ # Checking SHOW ALL SLAVES STATUS
32
+ #
33
+ Connection_name = 'master1'
34
+ Master_Port = 'MYPORT_1'
35
+ Relay_Log_File = 'mysqld-relay-bin-master1.000002'
36
+ Slave_IO_Running = 'Yes'
37
+ Slave_SQL_Running = 'Yes'
38
+ Last_Errno = '0'
39
+ Last_SQL_Errno = '0'
40
+ Slave_heartbeat_period = '60.000'
41
+ #
21
42
drop database if exists db1;
22
43
create database db1;
23
44
use db1;
@@ -74,10 +95,26 @@ master_host='127.0.0.1',
74
95
master_user='root';
75
96
start slave;
76
97
include/wait_for_slave_to_start.inc
77
- show all slaves status;
78
- Connection_name Slave_SQL_State Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert Last_IO_Errno Last_IO_Error Last_SQL_Errno Last_SQL_Error Replicate_Ignore_Server_Ids Master_Server_Id Master_SSL_Crl Master_SSL_Crlpath Using_Gtid Gtid_IO_Pos Retried_transactions Max_relay_log_size Executed_log_entries Slave_received_heartbeats Slave_heartbeat_period Gtid_Slave_Pos
79
- Slave has read all relay log; waiting for the slave I/O thread to update it Waiting for master to send event 127.0.0.1 root MYPORT_2 60 master-bin.000001 313 mysqld-relay-bin.000002 601 master-bin.000001 Yes Yes 0 0 313 899 None 0 No 0 No 0 0 2 No 0 1073741824 7 0 60.000 0-1-4
80
- master1 Slave has read all relay log; waiting for the slave I/O thread to update it Waiting for master to send event 127.0.0.1 root MYPORT_1 60 master-bin.000001 988 mysqld-relay-bin-master1.000002 1276 master-bin.000001 Yes Yes 0 0 988 1582 None 0 No 0 No 0 0 1 No 0 1073741824 17 0 60.000 0-1-4
98
+ #
99
+ # Checking SHOW ALL SLAVES STATUS
100
+ #
101
+ Connection_name = ''
102
+ Connection_name = 'master1'
103
+ Master_Port = 'MYPORT_2'
104
+ Master_Port = 'MYPORT_1'
105
+ Relay_Log_File = 'mysqld-relay-bin.000002'
106
+ Relay_Log_File = 'mysqld-relay-bin-master1.000002'
107
+ Slave_IO_Running = 'Yes'
108
+ Slave_IO_Running = 'Yes'
109
+ Slave_SQL_Running = 'Yes'
110
+ Slave_SQL_Running = 'Yes'
111
+ Last_Errno = '0'
112
+ Last_Errno = '0'
113
+ Last_SQL_Errno = '0'
114
+ Last_SQL_Errno = '0'
115
+ Slave_heartbeat_period = '60.000'
116
+ Slave_heartbeat_period = '60.000'
117
+ #
81
118
insert into t1 (f1) values ('three');
82
119
drop database if exists db2;
83
120
create database db2;
@@ -104,10 +141,26 @@ Log_name File_size
104
141
master-bin.000002 367
105
142
insert into t1 (f1) values ('four');
106
143
create table db1.t3 (f1 int) engine=InnoDB;
107
- show all slaves status;
108
- Connection_name Slave_SQL_State Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert Last_IO_Errno Last_IO_Error Last_SQL_Errno Last_SQL_Error Replicate_Ignore_Server_Ids Master_Server_Id Master_SSL_Crl Master_SSL_Crlpath Using_Gtid Gtid_IO_Pos Retried_transactions Max_relay_log_size Executed_log_entries Slave_received_heartbeats Slave_heartbeat_period Gtid_Slave_Pos
109
- Slave has read all relay log; waiting for the slave I/O thread to update it Waiting for master to send event 127.0.0.1 root MYPORT_2 60 master-bin.000001 921 mysqld-relay-bin.000002 1209 master-bin.000001 Yes Yes 0 0 921 1507 None 0 No 0 No 0 0 2 No 0 1073741824 17 0 60.000 0-1-7
110
- master1 Slave has read all relay log; waiting for the slave I/O thread to update it Waiting for master to send event 127.0.0.1 root MYPORT_1 60 master-bin.000002 740 mysqld-relay-bin-master1.000004 1028 master-bin.000002 Yes Yes 0 0 740 1378 None 0 No 0 No 0 0 1 No 0 1073741824 37 0 60.000 0-1-7
144
+ #
145
+ # Checking SHOW ALL SLAVES STATUS
146
+ #
147
+ Connection_name = ''
148
+ Connection_name = 'master1'
149
+ Master_Port = 'MYPORT_2'
150
+ Master_Port = 'MYPORT_1'
151
+ Relay_Log_File = 'mysqld-relay-bin.000002'
152
+ Relay_Log_File = 'mysqld-relay-bin-master1.000004'
153
+ Slave_IO_Running = 'Yes'
154
+ Slave_IO_Running = 'Yes'
155
+ Slave_SQL_Running = 'Yes'
156
+ Slave_SQL_Running = 'Yes'
157
+ Last_Errno = '0'
158
+ Last_Errno = '0'
159
+ Last_SQL_Errno = '0'
160
+ Last_SQL_Errno = '0'
161
+ Slave_heartbeat_period = '60.000'
162
+ Slave_heartbeat_period = '60.000'
163
+ #
111
164
select * from db1.t1;
112
165
i f1
113
166
1 one
0 commit comments