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 cluster, removes the specified leaf node from the Master Aggregator, and the leaf node will be removed from the SHOW LEAVES command.
-
While the cluster will no longer know about this leaf node, Toolbox will still know that
memsqlctl
recognizes that there is a runningmemsql
process which is now in theunknown
state. -
A leaf node that has been removed can be added back to the cluster, without any loss of data, by using the ADD LEAF command.
-
This command causes implicit commits.
Refer to COMMIT for more information. -
Refer to sdb-admin delete-node to delete a leaf node and its data.
-
Refer to the Permission Matrix for the required permission.
Syntax
REMOVE LEAF 'host':port [FORCE][KILL]
Remarks
-
Port value 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 partition databases that were moved are no longer present on the node. -
You must use the
ADD LEAF
command if you want to reintroduce the removed leaf into the system. -
This command can be run on the master aggregator node, or a child aggregator node (see Node Requirements for SingleStore Commands ).
-
The
FORCE
flag disables the rebalancing behavior ofREMOVE LEAF
.This behavior is designed to keep the database online while you remove a leaf from the system. However, if you are performing maintenance and want to quickly remove a leaf node without keeping the database online, then use the FORCE
flag to disable automatic rebalancing. -
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).Auto-rebalances automatically use the KILL
mode if the auto-rebalance fails to run after three attempts. -
If MemSQL Ops is not enabled for manual cluster control, then a
REMOVE LEAF
can result in the leaf being added back without user intervention.
Example
REMOVE LEAF '192.168.1.110':3306;
REMOVE LEAVES
Removes all leaf nodes without removing the data.
See REMOVE LEAF
section above for further information.
Syntax
REMOVE LEAVES [IF EXISTS] ('host_1':port_1, ..., 'host_n':port_n) [FORCE]
Remarks
-
REMOVE LEAVES
is an all-or-nothing command either all the leaves will be removed, or none of them will.
Example
REMOVE LEAVES ('192.168.1.110':3306, '192.168.1.111':3306, '192.168.1.112':3306);
Related Topics
Last modified: July 2, 2024