This topic describes the resource specification command group in obshell. This command group is used to manage resource specifications in an OceanBase cluster. Before you use the commands in this group, make sure that the OceanBase cluster has been initialized. You can configure the -h/--help option in each command for more information.
obshell unit create
You can use this command to create a new 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 OceanBase Database. unit_config_name is the name that you specify for the resource specification.
The table below describes the options of this command:
Option |
Required |
Data type |
Default value |
Description |
|---|---|---|---|---|
| -m/--memory_size | Yes | string | None | The minimum memory specification is controlled by the hidden parameter __min_full_resource_pool_memory (default value: 5G). To ensure system stability, we recommend that you set the minimum memory specification to at least 4G. |
| -c/--max_cpu | Yes | float | None | The maximum CPU specification. The minimum value is 1, which indicates 1 core. |
| --min_cpu | No | float | None | The minimum CPU specification. The minimum value is 1, which indicates 1 core. If this option is not specified, its value is equal to the value of the -c or --max_cpu option. |
| --max_iops | No | int | None | The maximum IOPS. The minimum value is 1024. The value of this option cannot be less than the value of the --min_iops option. If this option is not specified, the system will automatically calculate the value of --max_iops based on the following rules:
|
| --min_iops | No | int | None | The minimum IOPS. The minimum value is 1024. If this option is not specified, the system will automatically calculate the value of --min_iops based on the following rules:
|
| --log_disk_size | No | string | None | The size of the log disk space for a tenant. If this option is not specified, the default value, which is three times the memory specification and not less than 2 GB, applies. |
obshell unit show
You can use this command to query 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 OceanBase Database. unit_config_name is the name that you specify for the resource specification. If this option is not specified, all unit resource specifications in the cluster are displayed.
obshell unit drop
You can use this command to delete a specified unused resource configuration.
${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 OceanBase Database installation directory by default. You need to set unit_config_name to the name of the resource configuration to be deleted.
You can use the -y or --yes option to specify not to prompt for confirmation. This option does not require a value. If you specify this option, the confirmation prompt is canceled.
