MYSQL Chaining
This describes setting up a new chain with mysql replication.
This is the basic layout. (M master, S1 slave of master, S2 slave of S1)
M <- S1 <- S2
Creating a chain:
service mysqld stop;
Log into your new image, S2:
12 from /etc/my.cnf , ensure read-only = true
This is the basic layout. (M master, S1 slave of master, S2 slave of S1)
M <- S1 <- S2
Creating a chain:
- On S1:
service mysqld stop;
- Create an image of S1, this will be S2. In GCP go to the VM instance of S1, click on its disk, click create Image.
Log into your new image, S2:
- edit /etc/my.cnf, add a way to skip the start of a slave.
- Remove the old UUID, this needs to be unique, so delete it,
- change the server-id to anything unique
-
systemctl enable mysqld; #ensure mysql will start on boot
-
service mysqld start;
-
reset slave;
-
Set the new master position. These should be the numbers from step 1.
-
start slave;
-
remove, from /etc/my.cnf the skipping of a slave
12 from /etc/my.cnf , ensure read-only = true
- go to S1; systemctl enable mysqld; service mysqld start;
Comments
Post a Comment