clusters
¶
The clusters
command lets you manage cluster products.
Tip
Be careful when specifying passwords on the command line. Some non-alphanumeric characters may be interpreted in an unexpected way by your shell. Use string delimitation and escape characters as needed.
Warning
Some clusters
commands are only available for CrateDB Cloud sysadmins
(superusers). A warning will indicate at the bottom of the documentation
for each command when this is the case. They are listed here solely to
clarify their function. You can also get information on any command by
appending --help
.
Usage: croud clusters [-h]
{get,list,deploy,scale,upgrade,delete,restart-node,set-deletion-protection,set-ip-whitelist,expand-storage,set-suspended-state}
...
clusters list
¶
Usage: croud clusters list [-h] [-p PROJECT_ID] [--org-id ORG_ID]
[--region REGION]
[--output-fmt {table,wide,json,yaml}] [--sudo]
Optional Arguments¶
- -p, --project-id
The project ID to use.
- --org-id
The organization ID to use.
- --region, -r
Temporarily use the specified region that command will be run in.
- --output-fmt, --format, -o
Possible choices: table, wide, json, yaml
Change the formatting of the output.
- --sudo
Run the given command as superuser.
Default: False
Example¶
sh$ croud clusters list
+--------------------------------------+------------------------+----------+--------------+--------------------------------------+-------------+--------------------------------------------------+
| id | name | numNodes | crateVersion | projectId | username | fqdn |
|--------------------------------------+------------------------+----------+--------------+--------------------------------------+-------------+--------------------------------------------------|
| 8d6a7c3c-61d5-11e9-a639-34e12d2331a1 | my-first-crate-cluster | 1 | 4.5.1 | 952cd102-91c1-4837-962a-12ecb71a6ba8 | default | my-first-crate-cluster.eastus.azure.cratedb.net. |
+--------------------------------------+------------------------+----------+--------------+--------------------------------------+-------------+--------------------------------------------------+
clusters deploy
¶
Usage: croud clusters deploy [-h] --product-name PRODUCT_NAME --tier TIER
[--unit UNIT] -p PROJECT_ID --cluster-name
CLUSTER_NAME --version VERSION --username
USERNAME --password PASSWORD
[--channel {stable,testing,nightly}]
[--cpus CPUS] [--disks DISKS]
[--disk-size-gb DISK_SIZE_GB]
[--disk-type {standard,premium}]
[--memory-size-mb MEMORY_SIZE_MB]
[--subscription-id SUBSCRIPTION_ID]
[--region REGION]
[--output-fmt {table,wide,json,yaml}] [--sudo]
Required Arguments¶
- --product-name
The product name to use.
- --tier
The product tier to use.
- -p, --project-id
The project ID to use.
- --cluster-name
The CrateDB cluster name to use.
- --version
The CrateDB version to use.
- --username
The CrateDB username to use.
- --password
The CrateDB password to use.
Optional Arguments¶
- --unit
The product scale unit to use.
- --channel
Possible choices: stable, testing, nightly
The channel of the CrateDB version (superusers only).
Default: “stable”
- --cpus
Number of CPU cores to allocate. Can be fractional. CrateDB Edge regions only.
- --disks
Number of disks to attach. CrateDB Edge regions only.
- --disk-size-gb
Size of disks to attach (in GiB).
- --disk-type
Possible choices: standard, premium
Type of disks to use. CrateDB Edge regions only.
- --memory-size-mb
Amount of memory to allocate (in MiB). CrateDB Edge regions only.
- --subscription-id
The subscription to use for billing of this cluster. Can be omitted by superusers to create clusters w/o billing.
- --region, -r
Temporarily use the specified region that command will be run in.
- --output-fmt, --format, -o
Possible choices: table, wide, json, yaml
Change the formatting of the output.
- --sudo
Run the given command as superuser.
Default: False
Example¶
sh$ croud clusters deploy \
--product-name cr1 \
--tier default \
--cluster-name my-first-crate-cluster \
--project-id 952cd102-91c1-4837-962a-12ecb71a6ba8 \
--version 4.8.0 \
--username admin \
--password "s3cr3t!" \
--subscription-id 782dfc00-7b25-4f48-8381-b1b096dd1619
+--------------------------------------+------------------------+----------+--------------+--------------------------------------+-------------+--------------------------------------------------+
| id | name | numNodes | crateVersion | projectId | username | fqdn |
|--------------------------------------+------------------------+----------+--------------+--------------------------------------+-------------+--------------------------------------------------|
| 8d6a7c3c-61d5-11e9-a639-34e12d2331a1 | my-first-crate-cluster | 1 | 4.8.0 | 952cd102-91c1-4837-962a-12ecb71a6ba8 | admin | my-first-crate-cluster.eastus.azure.cratedb.net. |
+--------------------------------------+------------------------+----------+--------------+--------------------------------------+-------------+--------------------------------------------------+
==> Info: Cluster creation initiated. It may take a few minutes to complete.
==> Info: Status: REGISTERED (Your creation request was received and is pending processing.)
==> Info: Status: IN_PROGRESS (Cluster creation started. Waiting for the node(s) to be created and creating other required resources.)
==> Success: Operation completed.
+--------------------------------------+------------------------+----------+--------------+--------------------------------------+-------------+--------------------------------------------------+
| id | name | numNodes | crateVersion | projectId | username | fqdn |
|--------------------------------------+------------------------+----------+--------------+--------------------------------------+-------------+--------------------------------------------------|
| 8d6a7c3c-61d5-11e9-a639-34e12d2331a1 | my-first-crate-cluster | 1 | 4.8.0 | 952cd102-91c1-4837-962a-12ecb71a6ba8 | admin | my-first-crate-cluster.eastus.azure.cratedb.net. |
+--------------------------------------+------------------------+----------+--------------+--------------------------------------+-------------+--------------------------------------------------+
clusters scale
¶
Usage: croud clusters scale [-h] --cluster-id CLUSTER_ID --unit UNIT
[--region REGION]
[--output-fmt {table,wide,json,yaml}] [--sudo]
Required Arguments¶
- --cluster-id
The CrateDB cluster ID to use.
- --unit
The product scale unit to use.
Optional Arguments¶
- --region, -r
Temporarily use the specified region that command will be run in.
- --output-fmt, --format, -o
Possible choices: table, wide, json, yaml
Change the formatting of the output.
- --sudo
Run the given command as superuser.
Default: False
Example¶
sh$ croud clusters scale \
--project-id 952cd102-91c1-4837-962a-12ecb71a6ba8 \
--cluster-id 8d6a7c3c-61d5-11e9-a639-34e12d2331a1 \
--unit 1
+--------------------------------------+------------------------+----------+
| id | name | numNodes |
|--------------------------------------+------------------------+----------|
| 8d6a7c3c-61d5-11e9-a639-34e12d2331a1 | my-first-crate-cluster | 2 |
+--------------------------------------+------------------------+----------+
==> Info: Cluster scaling initiated. It may take a few minutes to complete the changes.
==> Info: Status: SENT (Your scaling request was sent to the region.)
==> Info: Status: IN_PROGRESS (Scaling up from 2 to 3 nodes. Waiting for new node(s) to be present.)
==> Success: Operation completed.
+--------------------------------------+------------------------+----------+
| id | name | numNodes |
|--------------------------------------+------------------------+----------|
| 8d6a7c3c-61d5-11e9-a639-34e12d2331a1 | my-first-crate-cluster | 3 |
+--------------------------------------+------------------------+----------+
Note
This command will wait for the cluster scaling to finish or fail.
clusters upgrade
¶
Usage: croud clusters upgrade [-h] --cluster-id CLUSTER_ID --version VERSION
[--region REGION]
[--output-fmt {table,wide,json,yaml}] [--sudo]
Required Arguments¶
- --cluster-id
The CrateDB cluster ID to use.
- --version
The CrateDB version to use.
Optional Arguments¶
- --region, -r
Temporarily use the specified region that command will be run in.
- --output-fmt, --format, -o
Possible choices: table, wide, json, yaml
Change the formatting of the output.
- --sudo
Run the given command as superuser.
Default: False
Example¶
sh$ croud clusters upgrade \
--cluster-id 8d6a7c3c-61d5-11e9-a639-34e12d2331a1 \
--version 4.6.7
+--------------------------------------+------------------------+---------------+
| id | name | crate_version |
|--------------------------------------+------------------------+---------------|
| 8d6a7c3c-61d5-11e9-a639-34e12d2331a1 | my-first-crate-cluster | 4.6.6 |
+--------------------------------------+------------------------+---------------+
==> Info: Cluster upgrade initiated. It may take a few minutes to complete the changes.
==> Info: Status: SENT (Your upgrade request was sent to the region.)
==> Info: Status: IN_PROGRESS (Waiting for node 1/1 to be terminated...)
==> Info: Status: IN_PROGRESS (Waiting for node 1/1 to be restarted...)
==> Success: Operation completed.
+--------------------------------------+------------------------+---------------+
| id | name | crate_version |
|--------------------------------------+------------------------+---------------|
| 8d6a7c3c-61d5-11e9-a639-34e12d2331a1 | my-first-crate-cluster | 4.6.7 |
+--------------------------------------+------------------------+---------------+
Note
This command will wait for the cluster upgrade to finish or fail.
clusters delete
¶
Usage: croud clusters delete [-h] --cluster-id CLUSTER_ID [-y]
[--region REGION]
[--output-fmt {table,wide,json,yaml}] [--sudo]
Required Arguments¶
- --cluster-id
The CrateDB cluster ID to use.
Optional Arguments¶
- -y, --yes
Default: False
- --region, -r
Temporarily use the specified region that command will be run in.
- --output-fmt, --format, -o
Possible choices: table, wide, json, yaml
Change the formatting of the output.
- --sudo
Run the given command as superuser.
Default: False
Example¶
sh$ croud clusters delete \
--cluster-id dc40090f-e1df-4974-b751-9fc27c824368
Are you sure you want to delete the cluster? [yN] y
==> Success: Cluster deleted.
Note
After deleting a cluster, existing backups will remain for 30 days since the last time a backup was made. While you won’t be able to restore these backups yourself, you can reach out to our support to have them restore a backup for you.
If you want a more recent backup, there are several options:
Create an AWS S3 repository with a
base_path
of/<project_id>/<cluster_id>/<name>
.<project_id>
and<cluster_id>
refer to the “dashed” form of the corresponding ID (XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
).<name>
can be any alphanumeric string. Afterwards, create a snapshot in your repository.Alternatively, you can create a backup as documented in the CrateDB documentation about snapshots on repositories and snapshots by e.g. providing your own AWS S3 bucket and credentials.
Lastly, the COPY TO SQL statement can be used to export a table to an AWS S3 bucket as well.
Important
When you provide your own external storage, please ensure that the location is not world readable or writable to prevent unauthorized access to your data!
clusters restart-node
¶
Usage: croud clusters restart-node [-h] --cluster-id CLUSTER_ID --ordinal
ORDINAL [--region REGION]
[--output-fmt {table,wide,json,yaml}]
[--sudo]
Required Arguments¶
- --cluster-id
The CrateDB cluster ID to use.
- --ordinal
The ordinal index of the node to restart.
Optional Arguments¶
- --region, -r
Temporarily use the specified region that command will be run in.
- --output-fmt, --format, -o
Possible choices: table, wide, json, yaml
Change the formatting of the output.
- --sudo
Run the given command as superuser.
Default: False
Example¶
sh$ croud clusters restart-node \
--cluster-id 8d6a7c3c-61d5-11e9-a639-34e12d2331a1 \
--ordinal 1
--sudo
+--------+----------+
| code | status |
|--------+----------|
| 200 | Success |
+--------+----------+
==> Success: Node restarted. It may take a few minutes to complete the changes.
Note
This command is only available for superusers.
clusters set-deletion-protection
¶
Usage: croud clusters set-deletion-protection [-h] --cluster-id CLUSTER_ID
--value VALUE [--region REGION]
[--output-fmt {table,wide,json,yaml}]
[--sudo]
Required Arguments¶
- --cluster-id
The CrateDB cluster ID to use.
- --value
The deletion protection status
Optional Arguments¶
- --region, -r
Temporarily use the specified region that command will be run in.
- --output-fmt, --format, -o
Possible choices: table, wide, json, yaml
Change the formatting of the output.
- --sudo
Run the given command as superuser.
Default: False
Example¶
sh$ croud clusters set-deletion-protection \
--cluster-id 8d6a7c3c-61d5-11e9-a639-34e12d2331a1 \
--value true
+--------------------------------------+------------------------+----------------------+
| id | name | deletion_protected |
|--------------------------------------+------------------------+----------------------|
| 8d6a7c3c-61d5-11e9-a639-34e12d2331a1 | my-first-crate-cluster | TRUE |
+--------------------------------------+------------------------+----------------------+
==> Success: Cluster deletion protection status successfully updated
Note
This command is only available for superusers and organization admins.
clusters set-ip-whitelist
¶
Usage: croud clusters set-ip-whitelist [-h] --cluster-id CLUSTER_ID --net NET
[-y] [--region REGION]
[--output-fmt {table,wide,json,yaml}]
[--sudo]
Required Arguments¶
- --cluster-id
The CrateDB cluster ID to use.
- --net
IP Network list in CIDR format (comma-separated).
Optional Arguments¶
- -y, --yes
Default: False
- --region, -r
Temporarily use the specified region that command will be run in.
- --output-fmt, --format, -o
Possible choices: table, wide, json, yaml
Change the formatting of the output.
- --sudo
Run the given command as superuser.
Default: False
Example¶
sh$ croud clusters set-ip-whitelist \
--cluster-id 8d6a7c3c-61d5-11e9-a639-34e12d2331a1 \
--net "10.1.2.0/24,192.168.1.0/24"
This will overwrite all existing CIDR restrictions. Continue? [yN] y
+--------------------------------------+------------------------+----------------+
| id | name | ip_whitelist |
|--------------------------------------+------------------------+----------------|
| 8d6a7c3c-61d5-11e9-a639-34e12d2331a1 | my-first-crate-cluster | NULL |
+--------------------------------------+------------------------+----------------+
==> Info: Updating the IP Network whitelist initiated. It may take a few minutes to complete the changes.
==> Info: Status: SENT (Your update request was sent to the region.)
==> Info: Status: IN_PROGRESS (Updating IP Network Whitelist.)
==> Success: Operation completed.
+--------------------------------------+------------------------+-------------------------------------------------------------------------------------------------+
| id | name | ip_whitelist |
|--------------------------------------+------------------------+-------------------------------------------------------------------------------------------------|
| 8d6a7c3c-61d5-11e9-a639-34e12d2331a1 | my-first-crate-cluster | [{"cidr": "10.1.2.0/24", "description": null}, {"cidr": "192.168.1.0/24", "description": null}] |
+--------------------------------------+------------------------+-------------------------------------------------------------------------------------------------+
Note
This command will wait for the operation to finish or fail.
clusters expand-storage
¶
Usage: croud clusters expand-storage [-h] --cluster-id CLUSTER_ID
--disk-size-gb DISK_SIZE_GB
[--region REGION]
[--output-fmt {table,wide,json,yaml}]
[--sudo]
Required Arguments¶
- --cluster-id
The CrateDB cluster ID to use.
- --disk-size-gb
New size of attached disks (in GiB).
Optional Arguments¶
- --region, -r
Temporarily use the specified region that command will be run in.
- --output-fmt, --format, -o
Possible choices: table, wide, json, yaml
Change the formatting of the output.
- --sudo
Run the given command as superuser.
Default: False
Example¶
sh$ croud clusters expand-storage \
--cluster-id 8d6a7c3c-61d5-11e9-a639-34e12d2331a1 \
--disk-size-gb 512
+--------------------------------------+------------------------+------------------------------------+
| id | name | hardware_specs |
|--------------------------------------+------------------------+------------------------------------|
| 8d6a7c3c-61d5-11e9-a639-34e12d2331a1 | my-first-crate-cluster | Disk size: 256.0 GiB |
+--------------------------------------+------------------------+------------------------------------+
==> Info: Cluster storage expansion initiated. It may take a few minutes to complete the changes.
==> Info: Status: REGISTERED (Your storage expansion request was received and is pending processing.)
==> Info: Status: SENT (Your storage expansion request was sent to the region.)
==> Info: Status: IN_PROGRESS (Suspending cluster and waiting for Persistent Volume Claim(s) to be resized.)
==> Info: Status: IN_PROGRESS (Starting cluster. Scaling back up to 3 nodes. Waiting for node(s) to be present.)
==> Success: Operation completed.
+--------------------------------------+------------------------+------------------------------------+
| id | name | hardware_specs |
|--------------------------------------+------------------------+------------------------------------|
| 8d6a7c3c-61d5-11e9-a639-34e12d2331a1 | my-first-crate-cluster | Disk size: 512.0 GiB |
+--------------------------------------+------------------------+------------------------------------+
Note
This command will wait for the operation to finish or fail. It is only available for superusers and organization admins. Note that for Azure users, any storage increase exceeding a given increment (32, 64, etc.) will be priced at the level of the next increment.
clusters set-suspended-state
¶
Usage: croud clusters set-suspended-state [-h] --cluster-id CLUSTER_ID --value
VALUE [--region REGION]
[--output-fmt {table,wide,json,yaml}]
[--sudo]
Required Arguments¶
- --cluster-id
The CrateDB cluster ID to use.
- --value
The suspended status.
Optional Arguments¶
- --region, -r
Temporarily use the specified region that command will be run in.
- --output-fmt, --format, -o
Possible choices: table, wide, json, yaml
Change the formatting of the output.
- --sudo
Run the given command as superuser.
Default: False
Example¶
sh$ croud clusters set-suspended-state \
--cluster-id 8d6a7c3c-61d5-11e9-a639-34e12d2331a1 \
--value true
+--------------------------------------+------------------------+----------------+
| id | name | suspended |
|--------------------------------------+------------------------+----------------|
| 8d6a7c3c-61d5-11e9-a639-34e12d2331a1 | my-first-crate-cluster | FALSE |
+--------------------------------------+------------------------+----------------+
==> Info: Updating the cluster status initiated. It may take a few minutes to complete the changes.
==> Info: Status: SENT (Your update request was sent to the region.)
==> Info: Status: IN_PROGRESS (Suspending cluster.)
==> Success: Operation completed.
+--------------------------------------+------------------------+----------------+
| id | name | suspended |
|--------------------------------------+------------------------+----------------|
| 8d6a7c3c-61d5-11e9-a639-34e12d2331a1 | my-first-crate-cluster | TRUE |
+--------------------------------------+------------------------+----------------+
Note
This command will wait for the operation to finish or fail.