REMOVE LEAF
On this page
Removes a leaf node from a cluster without deleting its data.
This command rebalances the leaf node’s partitions into the remaining leaves on the cluster and removes the specified leaf node from the Master Aggregator.
While the cluster will no longer know about this leaf node, Toolbox will still know that memsqlctl recognizes that there is a running memsql process which is now in the unknown state.
Syntax
REMOVE LEAF 'host':port [FORCE] [KILL] [ENSURE_PARTITION_SAFETY]
FORCE
REMOVE LEAF is designed to keep the database online while you remove a leaf from the cluster.FORCE option to disable automatic rebalancing.REMOVE LEAF.
KILL
KILL prevents persistent long running write queries from blocking a clustering option for an arbitrarily long time (for example, a scale up or scale down or even an upgrade).KILL mode if the auto-rebalance fails to run after three attempts.
ENSURE_ PARTITION_ SAFETY
ENSURE_ prevents a leaf (or leaves) from being removed if it contains the last online instance of a partition.
Remarks
-
The default port is
3306. -
If the leaf does not have a pair, SingleStore will rebalance its partitions onto the remaining leaves before removing it.
After this rebalance process is over, the databases partition that were moved are no longer present on the node. -
You must use the
ADD LEAFcommand if you want to reintroduce the removed leaf into the cluster. -
Refer to sdb-admin delete-node to delete a leaf node and its data.
-
This command can be run on the master aggregator node, or a child aggregator node (refer to Node Requirements for SingleStore Commands ).
-
If MemSQL Ops is not enabled for manual cluster control, then a
REMOVE LEAFcan result in the leaf being added back without user intervention. -
This command causes implicit commits.
Refer to COMMIT for more information. -
Refer to the Permission Matrix for the required permissions.
Example
REMOVE LEAF '192.168.1.110':3306;
REMOVE LEAVES
Removes all leaf nodes without removing the data.
Refer to the REMOVE LEAF section for more information.
Note
REMOVE LEAVES is an all-or-nothing command, either all the leaves will be removed, or none of them will.
Syntax
REMOVE LEAVES [IF EXISTS] ('host_1':port_1, ..., 'host_n':port_n) [FORCE] [ENSURE_PARTITION_SAFETY]
Example
REMOVE LEAVES ('192.168.1.110':3306, '192.168.1.111':3306, '192.168.1.112':3306);
Related Topics
Last modified: March 10, 2026