AGGREGATOR SET AS MASTER

Promote a child aggregator to master aggregator.

Syntax

AGGREGATOR SET AS MASTER

Remarks

Instructions

The AGGREGATOR SET AS MASTER command is used to convert a child aggregator node to a master aggregator node. Run this command after all the traffic to the target MemSQL cluster is stopped.

Follow these steps to set a child aggregator as a master aggregator:

  1. Disable all query traffic to aggregators in the cluster to stop the workload on the MemSQL cluster.
  2. Stop long running queries in the cluster, if any.
  3. Confirm that the cluster and reference databases (if any) are in sync between the master aggregator and child aggregator that will be promoted. To check the position of databases, create a connection to the MemSQL node and run the SHOW DATABASES EXTENDED command.
  4. Disable detection of leaf failures and trigger failovers on the child aggregator. Set leaf_failure_detection variable on the target child aggregator to off. Perform this step from the master aggregator. If the current master aggregator is unresponsive, skip this step.
  5. Stop the master aggregator using the memsql-ops memsql-stop <master_aggregator_ID> or memsql-admin stop-node --memsql-id <master_aggregator_ID> command. Make sure the master aggregator is offline before proceeding.
  6. Clear the DNS cache on all the nodes in the cluster using the FLUSH HOSTS command.
  7. Promote the child aggregator to the master aggregator. Run the AGGREGATOR SET AS MASTER command on the target child aggregator. Execute the SELECT @@master_aggregator query. This query should return self.
  8. Enable leaf failure detection on the master aggregator. Set leaf_failure_detection variable to on.
  9. Remove the old master aggregator from the cluster using the REMOVE AGGREGATOR command.
  10. Delete the old master aggregator. Run the memsql-ops memsql-delete <node_ID> or memsql-admin delete-node <node_ID> command.

This command must be run on a child aggregator node (see Node Requirements for MemSQL Commands ).

Example

memsql> AGGREGATOR SET AS MASTER;
Query OK, 1 row affected (1 min 22.41 sec)

Related Topics

Was this article useful?