Outdated Version

You are viewing an older version of this section. View current production version.

ADD LEAF

Add a leaf node to a cluster.

Syntax

ADD LEAF user[:'password']@'host'[:port] [INTO GROUP {1|2}]

Remarks

  • user specifies the user other nodes in the cluster will use to connect to the leaf. This user should have super privileges as it will be used to run all queries and cluster management commands on the leaf.
  • password (default “") is optional. The password needed to log in to the leaf. This password can’t be changed once the leaf is added without first removing the leaf.
  • port (default 3306) is optional.
  • [INTO GROUP {1|2}] specifies the availability group, if applicable, to which you want to add the leaf. See Managing High Availability for more information. If you do not explicitly specify a group, MemSQL will automatically add the leaf into the smallest group less than or equal to redundancy_level.
  • If you run ADD LEAF on a host/port pair that already exists in SHOW LEAVES, MemSQL will return an error.
  • This command must be run on the master aggregator node (see Node Requirements for MemSQL Commands ).
  • ADD LEAF doesn’t automatically run REBALANCE PARTITIONS to move new data onto the leaf. REBALANCE needs to be run manually to move data. If you plan to add multiple leaves its most efficient to add them all first and run a single REBALANCE to move data onto the new leaves.
  • If the leaf was previously a part of the cluster any partitions still on the leaf when its added will be reattached as part of ADD LEAF.

Example

memsql> ADD LEAF 'root'@'192.168.1.110':3306;
Query OK, 1 row affected (0.00 sec)

Related Topics