?> addNode - WeAreCAS
builtins

addNode

Description

The `addNode` action dynamically adds one or more machines to a running SAS Cloud Analytic Services (CAS) server. This is a fundamental administrative task for scaling a CAS environment, allowing for the expansion of computational resources without restarting the entire server. It can be used to add either worker nodes to increase processing power and data capacity, or a backup controller to enhance high availability. This action is typically performed by administrators to manage the cluster's topology in response to changing workloads.

builtins.addNode / node={"string-1" <, "string-2", ...>}, role="CONTROLLER" | "WORKER";
Settings
ParameterDescription
nodeSpecifies the hostnames of the machines to be added to the server. You can provide a single hostname or a list of multiple hostnames.
roleSpecifies the role of the new machine(s). Use 'WORKER' to add computational nodes for processing data. Use 'CONTROLLER' to add a backup controller for high availability. Note that only two controllers (one primary, one backup) are supported in a CAS cluster. The default value is 'WORKER'.
Data Preparation
Context: No Data Creation Required

The `addNode` action is an administrative function used to manage the CAS server infrastructure. It does not operate on or require any specific dataset. The examples below demonstrate how to call the action to modify the server topology.

/* No data setup is needed for this action. The examples focus on server administration. */

Examples

This example demonstrates the most common use case: adding a single new worker machine to the CAS cluster to increase its processing capacity.

SAS® / CAS Code
Copied!
1PROC CAS;
2 BUILTINS.addNode /
3 node={"casworker01.example.com"},
4 role="WORKER";
5RUN;
Result :
The action will return a status indicating the success or failure of adding the specified machine as a worker node to the CAS server. A successful operation will integrate the new node into the cluster, making its resources available for subsequent tasks.

To significantly scale up the cluster's computational power, you can add a list of multiple worker machines in a single action call. This is efficient for large-scale expansions.

SAS® / CAS Code
Copied!
1PROC CAS;
2 BUILTINS.addNode /
3 node={"casworker02.example.com", "casworker03.example.com", "casworker04.example.com"},
4 role="WORKER";
5RUN;
Result :
The result will show the status for each machine being added. Upon success, all specified machines will be active worker nodes in the CAS cluster, ready to participate in distributed data processing.

This example shows how to add a backup controller to a CAS server that was initially started with only a primary controller. This is a critical step for establishing a high-availability (HA) configuration, ensuring server operations can failover if the primary controller becomes unavailable.

SAS® / CAS Code
Copied!
1PROC CAS;
2 BUILTINS.addNode /
3 node={"cascontroller02.example.com"},
4 role="CONTROLLER";
5RUN;
Result :
A successful execution will add the specified machine as the backup controller. The server status will then reflect a two-controller configuration (one primary, one backup). The action will fail if a backup controller already exists.

FAQ

What is the purpose of the builtins.addNode action in SAS Viya?
What is the basic CASL syntax for the addNode action?
What are the main parameters for the addNode action?
What happens when a machine is added with the 'CONTROLLER' role?
Are there any specific environments where the addNode action is disabled?

Associated Scenarios

Use Case
Dynamic Scaling of a CAS Cluster by Adding Multiple Worker Nodes

A retail analytics team is preparing for a major holiday sales event. They anticipate a surge in data processing for real-time customer behavior analysis and need to expand thei...

Use Case
Establishing High Availability by Adding a Backup Controller

A financial services firm is upgrading its CAS environment to ensure business continuity. The current setup has a single point of failure at the controller level. The objective ...

Use Case
Testing Failure Condition: Attempting to Add a Controller to an Existing HA Cluster

An administrator, unaware that the CAS cluster is already configured for high availability (with a primary and a backup controller), attempts to add another controller. This tes...