[root@master ~]
[root@slave ~]
mysql> create database abc;
Query OK, 1 row affected (0.03 sec)
[root@master ~]
tcpdump: verbose output suppressed, use -
v
or -vv
for
full protocol decode
listening on eth0, link-
type
EN10MB (Ethernet), capture size 65535 bytes
15:16:42.492828 IP 192.168.30.115.33408 > 192.168.30.116.3306: Flags [P.],
seq
1149949367:1149949391, ack 113323290, win 123, options [nop,nop,TS val 8373727 ecr 10837334], length 24
E..L&"@.@.VR...s...t....D.....-....{4].....
......]V.....create database abc
15:16:42.501837 IP 192.168.30.115.33408 > 192.168.30.116.3306: Flags [.], ack 12, win 123, options [nop,nop,TS val 8373736 ecr 11221763], length 0
E..4&
......;.
15:16:42.502356 IP 192.168.30.117.38626 > 192.168.30.116.3306: Flags [.], ack 3194819787, win 170, options [nop,nop,TS val 9637577 ecr 11221763], length 0
E..4.0@.@..Q...u...t.........m.............
......;.
[root@slave ~]
tcpdump: verbose output suppressed, use -
v
or -vv
for
full protocol decode
listening on eth0, link-
type
EN10MB (Ethernet), capture size 65535 bytes
mysql> use abc
Database changed
mysql> create table
test
(
id
int);
Query OK, 0 rows affected (0.41 sec)
mysql> insert into
test
values(1);
Query OK, 1 row affected (0.04 sec)
mysql>
select
* from
test
;
+------+
|
id
|
+------+
| 1 |
+------+
1 row
in
set
(0.01 sec)
[root@master ~]
tcpdump: verbose output suppressed, use -
v
or -vv
for
full protocol decode
listening on eth0, link-
type
EN10MB (Ethernet), capture size 65535 bytes
15:20:42.054548 IP 192.168.30.115.33419 > 192.168.30.116.3306: Flags [P.],
seq
976065559:976065590, ack 2591052457, win 123, options [nop,nop,TS val 8613289 ecr 11418139], length 31
E..S."@.@..J...s...t....:-...pR....{.H.....
..m...:......insert into
test
values(1)
15:20:42.085305 IP 192.168.30.117.38626 > 192.168.30.116.3306: Flags [.], ack 3194820258, win 189, options [nop,nop,TS val 9877161 ecr 11461346], length 0
E..4.2@.@..O...u...t.........m.......*.....
........
15:20:42.086686 IP 192.168.30.115.33419 > 192.168.30.116.3306: Flags [.], ack 12, win 123, options [nop,nop,TS val 8613320 ecr 11461347], length 0
E..4.
..m.....
[root@slave ~]
tcpdump: verbose output suppressed, use -
v
or -vv
for
full protocol decode
listening on eth0, link-
type
EN10MB (Ethernet), capture size 65535 bytes
15:20:52.076327 IP 192.168.30.115.59899 > 192.168.30.117.3306: Flags [P.],
seq
201259223:201259232, ack 2661648116, win 115, options [nop,nop,TS val 8623261 ecr 9819401], length 9
E..=..@.@......s...u...............s.&.....
....... .....abc.
15:20:52.076821 IP 192.168.30.115.59899 > 192.168.30.117.3306: Flags [.], ack 12, win 115, options [nop,nop,TS val 8623261 ecr 9887103], length 0
E..4..@.@......s...u...............s
........
15:20:52.077609 IP 192.168.30.115.59899 > 192.168.30.117.3306: Flags [P.],
seq
9:32, ack 12, win 115, options [nop,nop,TS val 8623262 ecr 9887103], length 23
E..K..@.@......s...u...............s.......
.............
select
* from
test
15:20:52.118046 IP 192.168.30.115.59899 > 192.168.30.117.3306: Flags [.], ack 82, win 115, options [nop,nop,TS val 8623303 ecr 9887105], length 0
E..4..@.@......s...u...........E...s"......
观察抓包情况,发现所有的更新操作都在master,查询操作都在slave 上面