Outdated Version
You are viewing an older version of this section. View current production version.
ATTACH LEAF
Info
SingleStore Managed Service does not support this command.
Attaches a detached leaf into the cluster, re-introducing its data (if possible).
Syntax
ATTACH LEAF 'host':port [FORCE] [NO REBALANCE]
Remarks
ATTACH LEAFwill transition the leaf from thedetachedstate to theonlinestate.ATTACHis used to reintroduce a leaf back into the system. By default,ATTACH LEAFalso performs any rebalance and resyncing actions needed to bring the leaf up to date with the rest of the cluster. To attach a leaf without rebalancing partitions, use theNO REBALANCEoption. For more information see REBALANCE PARTITIONS .ATTACH LEAFcan only be run on leaf nodes that are present inSHOW_LEAVES.- This command must be run on the master aggregator node (see Node Requirements for SingleStore DB Commands ).
- The
FORCEflag overrides any conflicts that would preventATTACH LEAFfrom running. In practice, this happens when the data on the leaf has diverged away from the current state of the cluster (for example, a database was recreated while the leaf was down). You do not need toATTACH LEAF ... FORCEby default.ATTACH LEAFwithout theFORCEflag collects information about which databases on the leaf are conflicting and the error message indicates directly that you should add theFORCEflag. By specifying theFORCEflag, you enableATTACH LEAFto ignore the conflicting data on the node you are attaching. TheFORCEflag does not drop the conflicting databases on the node, but you can remove orphaned database partitions on the leaf by running theATTACH LEAF FORCEcommand followed by theCLEAR ORPHAN DATABASEScommand. - If you want to reattach many leaves at one time, after restarting a cluster, for example, you can use ATTACH LEAF ALL.
- Detached leaves automatically reattach. To disable this feature, set the global variable
auto_attachtofalse. For more information see SET GLOBAL .
Example
ATTACH LEAF '192.168.1.110':3306;
Related Topics