Updated on 2025-10-23 GMT+08:00

DROP NODE

Description

Deletes nodes from a cluster.

Precautions

DROP NODE is an API of the cluster management tool. You are advised not to use this API, because doing so affects the cluster. Only an administrator has the permission to use this API.

Syntax

1
DROP NODE [ IF EXISTS ] nodename [WITH ( cnnodename [, ... ] )];

Parameters

  • IF EXISTS

    Reports a notice instead of an error if the specified node does not exist.

  • nodename

    Specifies the name of the node to be deleted.

    Value range: an existing node name

  • cnnodename

    Specifies the CN name. If this parameter is defined, the cluster nodes under the currently connected CN and the defined CN are deleted.

    Value range: an existing CN name

If there are multiple CNs, cluster nodes are created only on the currently connected CNs and will not be synchronized to other CNs. You need to create cluster nodes on all CNs. To delete a cluster node, you only need to connect to one CN. If a cluster node is created on only one CN, you need to define the current CN name and delete the cluster node on the current CN.

Examples

-- Create cluster nodes on all CNs.
gaussdb=# CREATE NODE datanode1 WITH(
   TYPE = datanode,
   PREFERRED = false
);

-- Connect to only one CN to delete cluster nodes.
gaussdb=# DROP NODE datanode1;

Helpful Links

CREATE NODE and ALTER NODE