Remove a Node from a Cluster¶
-
DELETE
/api/v2/clusters/
(string: id_or_label)/nodes
¶
Use this API to remove a worker node from a cluster. This action starts the operation asynchronously. This API is supported only on Hadoop 2 and Presto clusters.
In Hadoop 2/Presto clusters, nodes are removed from the cluster gracefully, which means that a node is only removed after tasks/jobs running on that particular node get completed. A node is only removed only if the current cluster size is greater than the configured minimum cluster size in Hadoop 2/Presto clusters.
The operation can be monitored using the command ID in the response through the command status API.
Note
A cluster must be running to remove a node. A Remove Node API does not check for maximum size of the cluster. Currently, this function is supported only on Hadoop 2 and Presto clusters.
Required Role¶
The following users can make this API call:
- Users who belong to the system-admin group.
- Users who belong to a group associated with a role that allows removing nodes from an existing cluster. See Managing Groups and Managing Roles for more information.
Response¶
The response contains a JSON object representing the command ID of the remove node operation. All the attributes mentioned here are returned (except when otherwise specified or redundant).
Parameters¶
Note
Parameters marked in bold below are mandatory. Others are optional and have default values.
Parameter | Description |
---|---|
private_dns | Private DNS of the worker node. |
Examples¶
Example 1 shows an example to remove nodes and Example 2 shows an example to remove nodes by passing the private DNS of the worker node.
Example 1¶
To remove nodes from a cluster with 277344 as its ID.
curl -X DELETE
-H "X-AUTH-TOKEN:$AUTH_TOKEN"
-H "Content-Type:application/json" \
https://gcp.qubole.com/api/v2/clusters/277344/nodes
Example 2¶
To remove nodes from a cluster by specifying the private DNS of the worker node.
curl -i -X DELETE -H "X-AUTH-TOKEN:$AUTH_TOKEN" -H "Content-Type:application/json" \
https://gcp.qubole.com/api/v2/clusters/<cluster-id>/nodes?private_dns=<private_dns>