Managing clusters using the CLI
These examples show Azure as the cloud provider unless indicated otherwise. The functionality is the same when using AWS or Google Cloud.
Managing single-node and primary/standby high-availability clusters
Use the cluster
commands to create, retrieve information on, and manage single-node and primary/standby high-availability clusters.
Create a cluster in interactive mode
The default mode for the cluster create
and pgd create
commands is an interactive mode that guides you through the required cluster configuration by providing you with the valid values.
Tip
You can turn off prompting using the biganimal config set interactive_mode off
command. With prompting disabled, if any required flags are missing, the CLI exits with an error.
For example, to create a primary/standby high-availability cluster:
You're prompted to confirm that you want to create the cluster. After the cluster creation process is complete, it generates a cluster ID.
Check your cluster was created successfully using the cluster show
command shown in the return message:
Create a cluster using a configuration file
You can use the create --config-file
command to create one or more clusters with the same configuration in a noninteractive mode.
Here's a sample configuration file in YAML format with Azure specified as the provider:
Note
For backward compatibility, allowIpRangeMap
and pgConfigMap
properties also support embedded JSON format.
To create the cluster using the sample configuration file config_file.yaml
:
To enable you to view valid values to use in the configuration file for BigAnimal and cloud service provider-related properties, the CLI provides a series of cluster subcommands. For example, you can use cluster show-architectures
to list all BigAnimal database architectures available in your cloud service provider account:
Tip
You can turn off the confirmation step with the biganimal disable-confirm
command.
Get cluster connection information
To use your BigAnimal cluster, you first need to get your cluster's connection information. To get your cluster's connection information, use the cluster show-connection
command:
Tip
You can query the complete connection information with other output formats, like JSON or YAML. For example:
Update cluster
After the cluster is created, you can update attributes of the cluster, including both the cluster’s profile and its deployment architecture. You can update the following attributes:
- Cluster name
- Password of administrator account
- Cluster architecture
- Number of standby replicas
- Instance type of cluster
- Instance volume properties
- Networking
- Allowed IP list
- Postgres database configuration
- Volume properties, size, IOPS
- Retention period
- Read-only workloads
- IAM authentication
For example, to set the public allowed IP range list, use the --cidr-blocks
flag:
To check whether the setting took effect, use the cluster show
command, and view the detailed cluster information output in JSON format. For example:
Update the Postgres configuration of a cluster
To update the Postgres configuration of a BigAnimal cluster directly from the CLI:
To specify multiple configurations, you can use multiple --pg-config
flags or include multiple configuration settings as a key-value array string separated by commas in one --pg-config
flag. If a Postgres setting contains a comma, you need to specify it with a separate --pg-config
flag.
Note
You can update the cluster architecture with the --cluster-architecture
flag. The only supported scenario is to update a single-node cluster to a primary/standby high-availability cluster.
Delete a cluster
To delete a cluster you no longer need, use the cluster delete
command. For example:
You can list all deleted clusters using the show-deleted-clusters
command and restore them from their history backups as needed.
Restore a cluster
BigAnimal continuously backs up your PostgreSQL clusters. Using the CLI, you can restore a cluster from its backup to any point in time as long as the backups are retained in the backup storage. The restored cluster can be in another region and have different configurations. You can specify new configurations in the cluster restore
command. For example:
The password for the restored cluster is mandatory. The other parameters, if not specified, inherit the source database's settings.
To restore a deleted cluster, use the --from-deleted
flag in the command.
Note
You can restore a cluster in a single cluster to a primary/standby high-availability cluster and vice versa. You can restore a distributed high-availability cluster only to a cluster using the same architecture.
Managing distributed high-availability clusters
Use the BigAnimal pgd
commands to create, retrieve information on, and manage distributed high-availability clusters.
Note
In addition to the BigAnimal pgd
commands, you can switch over and use commands available in the EDB Postgres Distributed CLI to perform PGD-specific operations. The only EDB Postgres Distributed CLI commands that don't apply to BigAnimal are create-proxy
and delete-proxy
.
Create a distributed high-availability cluster
Create a distributed high-availability cluster using a YAML configuration file.
The syntax of the command is:
Where <config_file>
is a valid path to a YAML configuration file. For example:
Add a data group
Add a data group using a YAML configuration file.
The syntax of the command is:
Where <config_file>
is a valid path to a YAML configuration file. For example:
Update a distributed high-availability cluster
Update a distributed high-availability cluster and its data groups using a YAML configuration file.
The syntax of the command is:
Where <config_file>
is a valid path to a YAML configuration file with the same format as a configuration file for creating a distributed high-availability cluster. See Create a distributed high-availability cluster.
Show distributed high-availability clusters
Show all active clusters or a specific cluster. You can also optionally show deleted clusters.
The syntax of the command is:
Restore a distributed high-availability cluster
Restore a distributed high-availability cluster or a deleted distributed high-availability cluster to a new cluster on the same cloud provider. You can restore an active cluster or a deleted cluster within its retention period. You can restore only one data group. By default, the new cluster inherits all settings of the source cluster. You can change the cluster setting and database configurations by specifying new values in the configuration file.
The syntax of the command is:
Where <config_file>
is a valid path to a YAML configuration file. For example:
Get distributed high-availability cluster connection information
To connect to and use your BigAnimal distributed high-availability cluster, you first need to get your cluster group's connection information.
The syntax of the command is:
Delete a distributed high-availability cluster
Delete a specific BigAnimal distributed high-availability cluster.
The syntax of the command is:
The --id
and --group-id
flags are mandatory. For example:
- On this page
- Managing single-node and primary/standby high-availability clusters
- Managing distributed high-availability clusters
- Create a distributed high-availability cluster
- Add a data group
- Update a distributed high-availability cluster
- Show distributed high-availability clusters
- Restore a distributed high-availability cluster
- Get distributed high-availability cluster connection information
- Delete a distributed high-availability cluster