CentOS MySQL Combat 11th session
First question: Tips for duplicating fabric adjustments
How did A->b become
B->a
Master 192.168.1.10
RAM 16G
slave:192.168.1.11
Ram:32 G
is to add the original master's memory to 32G.
The original master introduced a VIP
app:192.168.1.10:3306 ....
vip:192.168.1.20
To bind the VIP to the original master, and then change the program to a new VIP connection, will affect the business?
Master Hostname:node1
Now change our configuration to 192.168.1.20.
PHP program configuration changes are not restarted
Will there be any impact on the business after restarting one of the apps on the front end?
TCP disconnection mechanism
Stateless, at least one node can be dead at the front end, and the front end is a cluster
Increase the VIP of the database this process can not affect the business
node1:1.10, 1.20
|
node2:1.11
Consider making Node1, node2 a double-master structure.
How do I write the change master to statement on Node1?
Two-Master principle: Because if you find the Binlog in the Master pass in the same serverid as yourself, do not perform
Traditional replication
Node2: Perform show master status;
Node1: Write the change master to statement according to the sentence above
Two all set log_slave_update
Gtid replication
Node2: Perform show master status;
Node1: Write the change master to statement according to the sentence auto-position
Two all set log_slave_update
If the switching conditions are allowed to end the business for 30 seconds, the data should be consistent, how can you do?
1. Front-facing preparation
Wu Bingxi (82565387) 20:56:33
1.1 Master VIP Unbind
1.2 Check if the original master has connection and connection processing if there is a connection: kill all those connections.
Select Concat ("Kill", ID, ";") from infomation_schema.processlist where user= ' xxx ' into outfile '/tmp/1.sql ';
Source/tmp/1.sql;
1.3 Confirm Sync Data complete
Requirements: slave.master_log_file= Master.log_file
Slave.read_master_pos = Master.log_pos
The reason is that the data is consistent.
1.4 SSH Slave VIP bind
The above steps, if the script is ready for 3 seconds, it can be done.
Now the business is supported in Node2
How do you get Node1 to sync from the Node2?
start slave; OK, because it is a double master, so the machine restarts directly after the start slave; OK, because the copy information is saved in the Masterinfo file
===============================
Perfectionism
Think Master cannot have show slave status output
If you do not want to see show slave status, then clear memory reset slave all;
R_ip:real IP
If it is a gtid model, can you copy it with a VIP?
can be used
Business without any problem of
Traditional replication
M1 Start Slave;
M2-> (M1, S1)
F
CentOS MySQL Combat 11th session