NOTE
Only the cluster_admin role has the privilege to perform this operation.
Syntax and parameters
FE
-
Add a Follower FE.
You can check the status of the new Follower FE by executing
SHOW PROC '/frontends'\G. -
Drop a Follower FE.
-
Add an Observer FE.
You can check the status of the new Observer FE by executing
SHOW PROC '/frontends'\G. -
Drop an Observer FE.
-
Transfer the Leader role to another Follower FE (graceful in-place handoff).
The target must be an alive Follower FE. This statement runs on the current Leader FE and hands the Leader role to the target Follower; the previous Leader then transitions to a Follower in place instead of restarting. Check the new Leader with
SHOW PROC '/frontends'\G. WithFORCE, the statement supersedes a Leader transfer that is already in progress at the BDBJE layer; withoutFORCE, it fails if such a transfer is in progress. ConcurrentTRANSFER LEADERstatements are serialized on the Leader: a queued statement waits for the previous one to finish, and returns an error if this FE is no longer the Leader when it gets its turn (it does not trigger a second transfer). Failure semantics: if the transfer itself fails (for example, the target cannot catch up within the internal 30-second window, or its cluster membership is not fully acknowledged yet), the statement returns an error and the current Leader stays unchanged - a safe outcome you can simply retry. If the transfer succeeds but the old Leader cannot drain its in-flight work withinleader_demotion_drain_timeout_sec, the old Leader process exits and restarts as a Follower; the new Leader is unaffected. This statement is not supported in shared-data clusters and returns an error there; to transfer leadership in shared-data mode, restart the current Leader FE to trigger an election.
BE
-
Add a BE node.
You can check the status of the new BE by executing SHOW BACKENDS.
-
Drop a BE node.
NOTE Without
FORCE, you cannot drop the BE node that stores the tablets of single-replica tables. WithFORCE, the BE node is dropped without this check, and the tablets of single-replica tables on it may be lost. -
Decommission a BE node.
Unlike dropping a BE node, which is removing it forcibly from the cluster, decommissioning a BE means removing it safely. It is an asynchronous operation. When a BE is decommissioned, the data on the BE is first migrated to other BEs, and then the BE is removed from the cluster. Data loading and query will not be affected during the data migration. You can check whether the operation is successful using SHOW BACKENDS. If the operation is successful, the decommissioned BE will not be returned. If the operation fails, the BE will still be online. You can manually cancel the operation using CANCEL DECOMMISSION.
CN
-
Add a CN node.
You can check the status of the new CN by executing SHOW COMPUTE NODES.
-
Drop a CN node.
NOTE
You cannot decommission a CN node using the ALTER SYSTEM DECOMMISSION command.
Broker
-
Add Broker nodes. You can use Broker nodes to load data from HDFS or cloud storage into the database. For more information, see Loading.
You can add multiple Broker nodes with one SQL. Each
<broker_host>:<broker_ipc_port>pair represents one Broker node. And they share a commonbroker_name. You can check the status of the new Broker node by executing SHOW BROKER. - Drop Broker nodes.
CAUTION Dropping a Broker node terminates the tasks currently running on it.
-
Drop one or multiple Broker nodes with the same
broker_name. -
Drop all Broker nodes with the same
broker_name.
Create image
Create an image file. An image file is a snapshot of the FE metadata.triggering a new checkpoint manually... in the fe.log of the Leader FE indicates that the image creation has started, and a log like finished save image... indicates the image has been created. From v3.4.0 onwards, the Leader FE selects an FE as the checkpoint worker to create the image, preferring FEs with lower heap usage over the Leader FE (unless checkpoint_only_on_leader is set to true), so the finished save image... log is printed in the fe.log of that FE. In earlier versions, the image is created on the Leader FE.
Usage notes
- Adding and dropping FE, BE, CN, or Broker nodes are synchronous operations. You cannot cancel the node dropping operations.
- You cannot drop the FE node in a single-FE cluster.
- You cannot directly drop the Leader FE node in a multi-FE cluster. To drop it, you must first restart it. After the database elects a new Leader FE, you can then drop the previous one.
- In a shared-nothing cluster, you cannot decommission BE nodes if the number of the remaining available BE nodes is less than the number of data replicas. For example, if you have three BE nodes in your cluster and you store your data in three replicas, you cannot decommission any of the BE nodes. And if you have four BE nodes and three replicas, you can decommission one BE node.
DROP BACKENDdoes not perform this check. WithoutFORCE, it only rejects a BE node that stores the tablets of single-replica tables. - The difference between dropping and decommissioning a BE node is that, when you drop a BE node, the database removes it forcibly from the cluster and make up the dropped tablets after the removal, and when you decommission a BE node, the database first migrates the tablets on the decommissioned BE node to others, and then removes the node.
Examples
Example 1: Add a Follower FE node.broker_name - hdfs.
amazon_s3.
amazon_s3.