{question}
What is PROMOTE AGGREGATOR, and when would I use it?
{question}
{answer}
This topic explains the PROMOTE AGGREGATOR ... TO MASTER
command, which was introduced in SingleStore 7.3.
PROMOTE AGGREGATOR ... TO MASTER command was introduced as an improvement to the existing AGGREGATOR SET AS MASTER command for maintenance activity scenarios.
Up to SingleStore 7.1 version AGGREGATOR SET AS MASTER
command was the only command available to convert a child aggregator node to a master aggregator node. The disadvantage of using the AGGREGATOR SET AS MASTER command is that we must remove and delete the old master aggregator once we set the child aggregator to be the new master node. Also, the Master shouldn't be online while converting the child to be the new master. To learn more about this command, click here.
For Example, Let’s take a cluster setup in which Node A is the master aggregator and Node B is a child aggregator:
- First, we execute
AGGREGATOR SET AS MASTER
on Node B while the master aggregator node A is offline. - Node B becomes master, and Node A must be uninstalled completely and re-deployed to be a child aggregator
- After re-deploying, now Node A is a child aggregator and Node B is the master aggregator.
- To set it back to the original state (Node A as the master & Node B as the child), we have to execute
AGGREGATOR SET AS MASTER
on Node A while the master Node B is down and the Node B must be destroyed completely and re-deployed to be the child aggregator.
The above process is a tedious and time-consuming operation for maintenance activity. Hence we introduced the below command in SingleStore version 7.3. This command is useful for host maintenance that requires a restart of the master aggregator or replacing the old master aggregator with new hardware. Using the below command, we don't rebuild the aggregators during the planned maintenance scenario.
PROMOTE AGGREGATOR '<host>':<port> TO MASTER;
This command promotes a child aggregator node to be the new master while demoting the current master to be the child. To learn more about this command, click here.
Note: The AGGREGATOR SET AS MASTER command is still a valid command which should be used when there is a permanent need to replace the existing master aggregator, such as a hardware failure of the master aggregator host.
Click here to upgrade to start using this feature, and to learn about deploying a new cluster, click here.
{answer}