Outdated Version

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

Master Aggregator

In a MemSQL cluster, the master aggregator is a specialized aggregator responsible for cluster monitoring and failover. The master aggregator orchestrates basic cluster operations and all DDL operations. Each MemSQL cluster has one master aggregator node.

Master Aggregator Startup

To manually specify a master aggregator in a MemSQL cluster without using MemSQL Ops, follow the steps below. These steps assume that you are creating a new cluster, and do not currently have a MemSQL node running on the desired host.

  1. Start the memsqld process on the desired host for the master aggregator.
  2. After the memsqld process has started, connect to MemSQL using either the root account or another account that has been granted the cluster privilege. A privileged account is required to run the following command.
  3. Once connected, execute the BOOTSTRAP AGGREGATOR command, which promotes the node to the master aggregator role. Consider the example below:
memsql> BOOTSTRAP AGGREGATOR '10.0.2.15';
Query OK, 0 rows affected (1.55 sec)

memsql> SHOW AGGREGATORS;
+-----------+------+--------+--------------------+------------------------------+-------------------+
| Host      | Port | State  | Opened_Connections | Average_Roundtrip_Latency_ms | Master_Aggregator |
+-----------+------+--------+--------------------+------------------------------+-------------------+
| 10.0.2.15 | 3306 | online |                  1 |                         NULL |                 1 |
+-----------+------+--------+--------------------+------------------------------+-------------------+
1 row in set (0.00 sec)

Once the master aggregator has been started, you can start adding child aggregators by using the ADD AGGREGATOR command, or leaf nodes by using the ADD LEAF command.

Recovering from a Master Aggregator Failure

If the master aggregator fails, the cluster remains online and functional. You can continue to run DML operations through any remaining aggregator. Only DDL operations and auto-failover are suspended until you restore the master aggregator. If you haven’t lost the master’s data directory, simply restart it and communication between it and the other nodes in the cluster will be re-established automatically. Otherwise, MemSQL supports promoting one of the remaining aggregators as the new master. To do this, run the AGGREGATOR SET AS MASTER command on the child aggregator you want to promote to master.