Appearance
CREATE CLUSTER
Create a new compute cluster or replace an existing cluster.
CREATE [ OR REPLACE ] [ COMPUTE ] CLUSTER [ IF NOT EXISTS ] name
WITH (
[ NODE_COUNT number, ]
[ DEFAULT_CLUSTER [ TRUE | FALSE ], ]
[ HARDWARE_INSTANCE name, ]
[ WLM_PROFILE name,]
[ AUTO_SUSPEND number | NULL,]
[ AUTO_RESUME TRUE | FALSE,]
[ MAX_SPILL_PCT number | NULL,]
[ INITIALLY_SUSPENDED ]
)
- OR REPLACE
- Create a new compute cluster, or replace an existing compute cluster if one exists with the same name within the same instance.
- COMPUTE
- Optional keyword; in the current release, all clusters are compute clusters. They do the work of executing queries and other operations such as bulk loads.
- name
- Unique name for a cluster within an instance. Use double quotes for the cluster name if it contains special characters.
- NODE_COUNT
- The number of worker nodes assigned to the cluster.
- DEFAULT_CLUSTER
- Whether this cluster is declared the default cluster for the instance. Only one cluster within a given instance may be the default cluster.
- HARDWARE_INSTANCE
- Hardware instance type:
small-v1
,small-v2
,large-v1
, orlarge-v2
. The cluster nodes must have the same hardware instance type. - WLM_PROFILE
- WLM (workload management) profile associated with the cluster. A default profile is assigned when a cluster is created.
- AUTO_SUSPEND
- The number of seconds of user inactivity, after which the cluster is automatically suspended.
- AUTO_RESUME
- Whether to automatically resume the cluster when a new user query is submitted against the cluster (and it is suspended).
- MAX_SPILL_PCT
- Maximum disk space allocated for spilling as a percentage of total disk space.
- INITIALLY_SUSPENDED
- Put the cluster in suspended state on creation. The user must resume the cluster when it is ready for use.
Examples
The following example creates a compute cluster called premdb-queries
with:
- One node
- The default WLM profile
- The small hardware instance type (
small-v1
) - Automatic suspension after 300 seconds
- Automatic resumption when a new query is run against the cluster
CREATE CLUSTER "premdb-queries" WITH (
NODE_COUNT 1,
WLM_PROFILE 'default',
HARDWARE_INSTANCE 'small-v1',
AUTO_SUSPEND 300,
AUTO_RESUME TRUE
);
CREATE COMPUTE CLUSTER
The following example creates a compute cluster called April12_LargeV1_2Nodes
with:
- 2 nodes
- The
flex
WLM profile - A large hardware instance (
large-v1
) - Automatic suspension after 30 seconds
- No automatic resumption when a new query is run against the cluster
- An initial suspended state (not running on creation)
CREATE CLUSTER "April12_LargeV1_2Nodes" WITH (
NODE_COUNT 2
, WLM_PROFILE 'flex'
, HARDWARE_INSTANCE 'large-v1'
, AUTO_SUSPEND 30
, AUTO_RESUME FALSE
, INITIALLY_SUSPENDED
);
CREATE COMPUTE CLUSTER
Parent topic:SQL Commands