File: rpl_network_namespace.result

package info (click to toggle)
mysql-8.0 8.0.43-3
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 1,273,924 kB
  • sloc: cpp: 4,684,605; ansic: 412,450; pascal: 108,398; java: 83,641; perl: 30,221; cs: 27,067; sql: 26,594; sh: 24,181; python: 21,816; yacc: 17,169; php: 11,522; xml: 7,388; javascript: 7,076; makefile: 2,194; lex: 1,075; awk: 670; asm: 520; objc: 183; ruby: 97; lisp: 86
file content (99 lines) | stat: -rw-r--r-- 3,881 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
include/master-slave.inc
Warnings:
Note	####	Sending passwords in plain text without SSL/TLS is extremely insecure.
Note	####	Storing MySQL user name or password information in the connection metadata repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START REPLICA; see the 'START REPLICA Syntax' in the MySQL Manual for more information.
[connection master]
call mtr.add_suppression("Hostname .* does not resolve to");
call mtr.add_suppression("IP address .* could not be resolved");
# Add a bind address in the 'red' network namespace to master
include/rpl_restart_server.inc [server_number=1 parameters: --bind-address=127.0.0.1,10.0.2.1/red]
# Add a bind address in the 'blue' network namespace to the slave
include/rpl_restart_server.inc [server_number=2 parameters: --bind-address=127.0.0.1,10.0.1.1/blue]
include/start_slave.inc
# Create tables and users.
CREATE TABLE t1(a int primary key, b varchar(10));
CREATE USER root@10.0.2.1;
GRANT ALL ON *.* TO root@10.0.2.1;
CREATE USER root@10.0.1.1;
GRANT ALL ON *.* TO root@10.0.1.1;
#Insert via connection to the address 127.0.0.1 from the default network namespace
INSERT INTO t1 VALUES (1, 'abc');
#Insert via connection to the address 10.0.2.1 from the 'red' network namespace
SHOW CREATE TABLE t1;
Table	Create Table
t1	CREATE TABLE `t1` (
  `a` int NOT NULL,
  `b` varchar(10) DEFAULT NULL,
  PRIMARY KEY (`a`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci
[ connection slave ]
include/sync_slave_sql_with_master.inc
SHOW CREATE TABLE t1;
Table	Create Table
t1	CREATE TABLE `t1` (
  `a` int NOT NULL,
  `b` varchar(10) DEFAULT NULL,
  PRIMARY KEY (`a`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci
# Check network namspace of currently connected master
SELECT network_namespace AS master_network_namespace FROM performance_schema.replication_connection_configuration;
master_network_namespace

SELECT Network_namespace FROM mysql.slave_master_info;
Network_namespace

Namespace from 'SHOW SLAVE STATUS' : 
# Check slave connection on the 'blue' namespace
a	b
1	abc
2	cdf
# Stop slave and run change master to listen to the master on socket
# created in the 'red' namespace
include/stop_slave.inc
[ connection master ]
#Insert via connection to the address 127.0.0.1 from the default network namespace
INSERT INTO t1 VALUES (3, 'ghi');
#Insert via connection to the address 10.0.2.1 from the 'red' network namespace
[ connection slave ]
# Change master to listen to the master on IP '10.0.2.1' in the 'red' namespace
include/start_slave.inc
include/sync_slave_sql_with_master.inc
# Check network namspace of currently connected master
SELECT network_namespace AS master_network_namespace FROM performance_schema.replication_connection_configuration;
master_network_namespace
red
SELECT Network_namespace FROM mysql.slave_master_info;
Network_namespace
red
Namespace from 'SHOW SLAVE STATUS' : red 
# Check slave connection on the 'blue' namespace
a	b
1	abc
2	cdf
3	ghi
4	jkl
# Check that the table is replicated properly
include/diff_tables.inc [master:t1, slave:t1]
include/stop_slave.inc
[ connection master ]
[ connection slave ]
# Change master to original connection
include/start_slave.inc
INSERT INTO t1 VALUES (5, 'mno');
include/sync_slave_sql_with_master.inc
# Check network namspace of currently connected master
SELECT network_namespace AS master_network_namespace FROM performance_schema.replication_connection_configuration;
master_network_namespace

SELECT Network_namespace FROM mysql.slave_master_info;
Network_namespace

Namespace from 'SHOW SLAVE STATUS' : 
# Check that the table is replicated properly
include/diff_tables.inc [master:t1, slave:t1]
# Cleanup
DROP USER root@10.0.2.1;
DROP USER root@10.0.1.1;
DROP TABLE t1;
include/sync_slave_sql_with_master.inc
include/rpl_end.inc