MariaDB Upgrade – Using the Diff Router – Part 3

Part 3  –  Configuring the Diff Router

This multipart series breaks down each section into easy logical steps.


To be able to use the Diff Router, which allows us to compare our old MariaDB Servers with our new one, we must first make some MaxScale changes.

MaxScale Configuration

On your MaxScale server, you need to add the new server, so that it knows it exists.

Bash
maxctrl create server server4 10.106.0.13 3306
maxctrl list servers

You should see your server listed, but it will be down, this is because we are not yet monitoring it. You should not monitor this server at this stage, so even though it is showing as down, you can assume it is OK!

Furthermore, you can also check that no traffic will be routed to this new server, via the services by running:

Bash
maxctrl list services

and your server should not be in the services list.


Configuring the Diff Router Service

Config Sync Cluster

Be very careful disabling this in a production system, instead you should ensure your MaxScale configuration is modified to not use config_sync_cluster when running this tool.

If you are using config_sync_cluster within MaxScale you are unable to create the Diff Router Service. It is therefore recommended that you back up your MaxScale configuration and disable config_sync_cluster:

Bash
maxctrl alter maxscale config_sync_cluster=''
Enable Diff Router Service

You now need to configure the Diff Router service so that you are able to compare what is running through the servers. To do this, we need to create a new service.

  • Diff-Service is the name of the new service I wish to create.
  • Application-Service is the name of the existing service which has the original server in it.
  • server1 is my original database server (in the Application-Service).
  • server4 is my new, now upgraded database server.
Bash
maxctrl call command diff create Diff-Service Application-Service server1 server4

If successful, you should see a response similar to:

Start the Diff Router Service

Now that your service is ready to be used, you can start it like this:

Bash
maxctrl call command diff start Diff-Service

If the service starts correctly, you should see:

You can check that the service has started correctly, by listing the services. You should see that your existing server1 is replaced with the new diff service.

Bash
maxctrl list services

Now you should see the additioanl service disaplyed:

You should also see that your new server (server4) has replication stopped. This is because the service duplicates every query on the new server. You can see that if you run the :

Bash
maxctrl list servers

If your new server, is still showing as a “Slave, Running”, then something did not quite work. It should look like this:

Stopping the Diff Router Service

To stop the service, run this command:

Bash
maxctrl call command diff stop Diff-Service

Your terminal should return output similar to this:

Destroying the diff router service

For completeness, if you want to destroy the service you have created, you can use this command. But, if you run this, you will need to create it again if you have not finished testing!

Bash
maxctrl call command diff destroy Diff-Service

If you check the services again:

Bash
maxctrl list services

You will see that the Diff-Service is no longer showing:


The next step is to learn how to use the new service in Part 4 of this series. 


Part 1 | Part 2 | Part 3 | Part 4 | Part 5

Kester Riley

Kester Riley is a Global Solutions Engineering Leader who leverages his website to establish his brand and build strong business relationships. Through his blog posts, Kester shares his expertise as a consultant, mentor, trainer, and presenter, providing innovative ideas and code examples to empower ambitious professionals.

#womeninit (1) CentOS (15) Connector (5) Continuous Availability (1) Cooperative Monitoring (3) diff router (5) High Availability (12) Java (3) MariaDB (21) MaxScale (19) Mentoring (1) Python (2) Replica Rebuild (10) Rocky Linux (15) upgrade (5) Work Place (1)

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.