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.
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:
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:
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.
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:
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.
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 :
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:
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!
maxctrl call command diff destroy Diff-Service
If you check the services again:
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.
Leave a Reply
You must be logged in to post a comment.