Part 6 — The Magic
This multi-part series breaks down each section into easy logical steps.
If you have not completed part 1, start here.
Replica Rebuild
The MaxScale Replica Rebuild functionality is amazing. It brings a ‘Galera-like’ rebuild process to any replica servers. These servers could be brand new servers, which just have MariaDB installed, or they could be failed replicas. You could use this to create new replicas in distant data centres, cloud services, or anywhere, that you would like a copy of your database to be. The only requirement is that it has an SSH connection configured, and MariaDB installed.
To rebuild a replica server, from the MaxScale server we use the maxctrl
command, calling the ‘async-rebuild-server’ functionality, we can build server2:
maxctrl call command mariadbmon async-rebuild-server Server-Monitor server2
Depending on the size of the database, the speed of the network and disks, will depend on how long this takes for the process to complete. I like to use a watch command on my MaxScale server so I can see when this is done:
watch "maxctrl list servers"
When server2 is showing as a ‘Slave, Running’ and the GTID numbers are synchronised. The secondary server is now in sync.
We can then move on to building the third server, by repeating the command on the MaxScale server:
maxctrl call command mariadbmon async-rebuild-server Server-Monitor server3
If you repeat the watch command, you will be able to see when the third server is up and running:
watch "maxctrl list servers"
Once the three servers are running and in sync, you have completed the Replica Rebuild process.
Move on to Part 7 to configure the rest of MaxScale, to allow it to take connections.
Part 1 | Part 2 | Part 3 | Part 4 | Part 5 | Part 6 | Part 7 | Part 8 | Part 9
Leave a Reply
You must be logged in to post a comment.