Remove Database Node (or Remove Node)
Removing a database node or removing a node helps you scale down your cluster. Scaling down a database cluster is useful when optimizing costs, reducing complexity, and maintaining an efficient infrastructure without over-provisioning resources. ClusterControl makes this straightforward providing you options to either just unregister the node in the ClusterControl, or stop the service, or stop and remove its configuration and the package installed. This is important especially if you are also going to reuse the node as a new resource for your other productivity or business use.
Removing a node does not convey its a destructive in nature such as wiping out the data or totally scrap the server itself ready for decomissioning. Removing a node is a term used here to manage the node by unregistering from ClusterControl management and services. It also offers the means of managing the configuration or service to just stop and normally terminates itself, does a graceful exit within the cluster to avoid abnormal consequences with regards to its cluster health.
Info
In this page, the term Node here refers to any node that is registered in ClusterControl such as database node, a load balancer, or even a backup verification server.
This page will guide you how to remove the node with ClusterControl.
Support Matrix
All database clusters that are supported by ClusterControl allows you to remove a node without affecting the other service. For a complete list of our supported database clusters, see below:
Database | Vendor | Topology |
---|---|---|
MySQL | Percona, Oracle | Standalone, replication |
MariaDB | MariaDB | Standalone, replication |
Galera Cluster | MariaDB, Percona | Galera certification-based replication |
PostgreSQL | PostgreSQL, EnterpriseDB | Standalone, streaming replication |
TimescaleDB | TimescaleDB | Standalone, streaming replication |
MongoDB | MongoDB, Percona, MongoDB Enterprise | Replica set, sharded cluster |
Redis | Redis, Valkey | Sentinel, cluster |
Microsoft SQL Server for Linux | Microsoft | Standalone, Always On availability group |
Elasticsearch | Elastic | Single-node cluster, high availability cluster |
Prerequisites
Only those registered nodes that are imported or deployed using ClusterControl can be managed to remove a node.
Deployment steps
The recipe for removing a database node is consistent and standardized to all database clusters we support.
-
In the Home dashboard page, Go to the Clusters view and choose your target database cluster.
-
Go to the Nodes tab.
-
Choose your desired node to be removed and click the ellipsis button (...) under the Actions field or column
-
Choose Remove node and this shall open a new dialog view
-
Under the Remove node dialog view, you have three options to choose from what actions should you desire:
-
Keep service running. If you choose this action, the following actions will be performed:
-
Node will be unregistered from ClusterControl but the service will be kept running
-
Node will be unregistered from load balancer (if applicable)
-
-
Stop service and keep files untouched. If you choose this action, the following actions will be performed:
- Node will be unregistered from ClusterControl and service will be stopped
-
Stop and uninstall service. If you choose his action, the following actions will be performed:
- Node will be unregistered, stopped and all software will be uninstalled
-
-
-
Click Remove to perform and execute the action
-
Remove a HAProxy node (that is running on port
9600
).- where
--cluster-id=99
targets the cluster having the cluster ID of 99. - where
--remove-node
defines the action to take - where
--nodes="192.168.40.60:9600"
will be the node to be removed. - where the
--wait
and--log
as the name suggest to print the job logs while waiting.
- where
-
To delete multiple nodes, you can simply achieve this by running a "for" loop. For example:
for i in 192.168.40.60:9600 192.168.40.61:9600 192.168.40.60:112 192.168.40.61:112; do s9s cluster --remove-node --cluster-id 99 --nodes="${i}" --print-request --print-json --wait --log; sleep 0.9; printf "0.%s" `seq 5`; done;
--print-request
parameter means to print the HTTP request for this action and--print-json
will print the logs in JSON format