When operating MariaDB MaxScale in dynamic environments—such as Kubernetes, where nodes are frequently provisioned and deleted—it is critical to cleanly remove decommissioned servers from your MaxScale configuration. To delete a server using maxctrl, one has to unlink the server from any services or monitors beforehand. This step-by-step guide walks you through the safe removal process, following the recommended teardown sequence: Listener ➔ Service ➔ Monitor ➔ Server.
Fast Track - Force Server Removal
While we may remove a server with the --force method, please use this approach with caution. If you are scripting this for Kubernetes or need to quickly remove a node, you can bypass the manual unlinking steps by using the --force option.
The --force option will automatically remove the server from monitors and services before destroying it.
Bypassing the manual unlinking steps may abruptly terminate active database sessions. Only use this if traffic has already been safely drained from the node at the orchestration layer.
maxctrldestroyservermariadbgalera3--force
1
Destroy the Listener (If Applicable)
If your setup utilizes a dedicated listener that must be removed alongside the server, you must destroy the listener first.
Destroying a listener closes the listening socket, opening it up for immediate reuse.
If two arguments are given and they are a service and a listener, the listener is only destroyed if it is for the given service.