This topic describes the obshell unit commands, which can be used to manage unit resource specifications in an OceanBase cluster. The obshell unit commands require that the OceanBase cluster has been initialized. You can run the command with the -h or --help option to view the help information.
obshell unit create
The obshell unit create command can be used to create a new unit resource specification for a cluster.
${home_path}/bin/obshell unit create <unit_config_name> -m -c [--min_cpu] [--log_disk_size] [--min_iops] [--max_iops]
# example
/home/admin/oceanbase/bin/obshell unit create unit_1 -m 5G -c 2
home_path is the installation directory of OceanBase Database. obshell is located in the bin directory of the installation directory by default. unit_config_name is the name of the resource specification to be created.
The following table describes the options of the command:
| Option | Required | Data type | Default value | Description |
|---|---|---|---|---|
| -m/--memory_size | Yes | string | N/A | The memory specification. The minimum value is controlled by the hidden parameter __min_full_resource_pool_memory (the default value is 5G). We recommend that you set the minimum memory specification to 4G to ensure system stability. |
| -c/--max_cpu | Yes | float | N/A | The maximum CPU specification. The minimum value is 1, indicating 1 core. |
| --min_cpu | No | float | N/A | The minimum CPU specification. The minimum value is 1, indicating 1 core. If this option is not specified, the value of this option is the same as the value of the -c or --max_cpu option. |
| --max_iops | No | int | N/A | The maximum IOPS specification. The minimum value is 1024. The value cannot be smaller than the value of the --min_iops option. If this option is not specified, the system automatically calculates the value of this option based on the following rules:
|
| --min_iops | No | int | N/A | The minimum IOPS specification. The minimum value is 1024. If this option is not specified, the system automatically calculates the value of this option based on the following rules:
|
| --log_disk_size | No | string | N/A | The size of the tenant log disk space. If this option is not specified, the value is three times the memory specification, with a minimum value of 2G. |
obshell unit show
The obshell unit show command can be used to query unit resource specifications.
${home_path}/bin/obshell unit show [unit_config_name]
# example
/home/admin/oceanbase/bin/obshell unit show
home_path is the installation directory of OceanBase Database. obshell is located in the bin directory of the installation directory by default. unit_config_name is the name of the resource specification to be queried. If this option is not specified, all unit resource specifications in the cluster are displayed.
obshell unit drop
The obshell unit drop command can be used to drop a specified unused unit resource specification.
${home_path}/bin/obshell unit drop <unit_config_name> [-y]
# example
/home/admin/oceanbase/bin/obshell unit drop unit_1
home_path is the installation directory of OceanBase Database. obshell is located in the bin directory of the installation directory by default. unit_config_name is the name of the resource specification to be dropped.
You can specify the -y or --yes option to skip the confirmation prompt. This option does not require a value. If specified, the confirmation prompt is skipped.