DROP BACKEND
Descriptionβ
This statement is used to remove BE nodes from the Doris cluster.
Syntaxβ
ALTER SYSTEM DROP BACKEND "<be_identifier>" [, "<be_identifier>" ... ]
Where:
be_identifier
: "<be_host>:<be_heartbeat_port>"
| "<backend_id>"
Required Parametersβ
1. <be_host>
It can be the hostname or IP address of the BE node.
2. <heartbeat_port>
The heartbeat port of the BE node, the default is 9050.
3. <backend_id>
The ID of the BE node.
tip
<be_host>
, <be_heartbeat_port>
, and <backend_id>
can all be obtained by querying with the SHOW BACKENDS statement.
Access Control Requirementsβ
The user who executes this SQL must have at least the following permissions:
Privilege | Object | Notes |
---|---|---|
NODE_PRIV |
Usage Notesβ
- It is not recommended to use this command to take a BE node offline. This command will directly remove the BE node from the cluster. The data on the current node will not be load-balanced to other BE nodes. Data loss may occur if there are single-replica tables in the cluster. A better approach is to use the DECOMMISSION BACKEND command to gracefully take the BE node offline.
- Since this operation is a high-risk operation, when you directly run this command:
ALTER SYSTEM DROP BACKEND "127.0.0.1:9050";
The above prompt message will appear. If you understand what you are doing, you can replace theERROR 1105 (HY000): errCode = 2, detailMessage = It is highly NOT RECOMMENDED to use DROP BACKEND stmt.It is not safe to directly drop a backend. All data on this backend will be discarded permanently. If you insist, use DROPP instead of DROP
DROP
keyword withDROPP
and continue:ALTER SYSTEM DROPP BACKEND "127.0.0.1:9050";
Examplesβ
-
Remove two nodes from the cluster based on the Host and HeartbeatPort of the BE nodes:
ALTER SYSTEM DROPP BACKEND "192.168.0.1:9050", "192.168.0.2:9050";
-
Remove one node from the cluster based on the ID of the BE node:
ALTER SYSTEM DROPP BACKEND "10002";