Purpose
This statement is used to change the source-side configuration of the backup or archive path for the current tenant, including the zone, idc, or region configuration, I/O throttling parameters (max_iops and max_bandwidth), and key information such as access_id and access_key. The new configuration will overwrite the original configuration.
Limitations and considerations
Only user tenants can execute this statement. System tenants (sys tenants) cannot execute this statement.
Before you modify the
zone,idc, orregionconfigurations of a path, if you need to set the region or IDC level, you must first use theALTER SYSTEM MODIFY ZONE zone_name SET REGION=region_name;orALTER SYSTEM MODIFY ZONE zone_name SET IDC=idc_name;statement to set the region or IDC information. It is recommended to set the source configuration at the IDC level. This allows you to use an IDC with more network bandwidth resources for backup tasks, providing a broader range of optional nodes. Additionally, you do not need to monitor changes in zones within the IDC of the cluster.When modifying the source configuration of a backup path, if a backup task is currently running, the running task may take up to a few minutes to recognize the configuration changes. During this period, nodes outside the configured scope may still access the backup path, potentially generating cross-facility or cross-regional traffic.
Only object storage paths support changing I/O throttling parameters (
max_iopsandmax_bandwidth) as well asaccess_idandaccess_keyinformation. If you attempt to set I/O throttling parameters (max_iopsandmax_bandwidth) oraccess_idandaccess_keyinformation for an NFS path, the system will return an unsupported error with the error code1235.When setting the
ACCESS_INFOattribute (access_idandaccess_keyinformation) for an object storage path, if the parameter format is incorrect (for example, if there are extra=signs or ifaccess_idoraccess_keyis missing), the system will return the errorOB_OBJECT_STORAGE_PERMISSION_DENIED(error code-9116).When accessing an object path using the Assume Role method for a backup path or an archive path:
If you set
ACCESS_INFO = 'access_id=new_access_id&access_key=new_access_key', the system will return an error.If you only set the I/O throttling parameters in the
ATTRIBUTEsection without setting theACCESS_INFOattribute, the system may indicate that it is unsupported or that the settings will not take effect.
You can set the same
ATTRIBUTE+ACCESS_INFOproperties multiple times for the same path.
Privilege requirements
The user who executes this statement must have the ALTER SYSTEM privilege. For more information about the privileges of OceanBase Database, see Privilege types in MySQL-compatible mode.
Syntax
ALTER SYSTEM {ALTER|CHANGE|MODIFY} EXTERNAL_STORAGE_DEST
PATH [=] 'path'
SET [ATTRIBUTE = '[{zone=zone_name | idc=idc_name | region=region_name}][&max_iops=iops_num][&max_bandwidth=bandwidth_num]']
[ACCESS_INFO = 'access_id=new_access_id&access_key=new_access_key'];
Parameters
| Parameter | Description |
|---|---|
| path | The backup or archive path where the key information to be modified is stored. This path must be a backup or archive path that has been set for the current tenant, and it must be an object storage path that contains the host information. For example, the path format is oss://oceanbase-test-bucket/backup/databackup?host=*** in the case of Alibaba Cloud OSS. |
| zone=zone_name | idc=idc_name | region=region_name | The source of the current backup or archive path. You can choose zone, idc, or region as the source. You can specify only one of them at a time or not specify any. If you do not explicitly specify a value, the default value is not set.When you modify the source of the archive path:
When you modify the source of the backup path:
|
| max_iops | The maximum IOPS allowed for the current backup or archive path. The value is a positive integer, indicating the number of I/O requests per second. If not explicitly set, the IOPS is not restricted, and the underlying object storage and network capabilities determine the IOPS. Example: |
| max_bandwidth | The maximum bandwidth allowed for the current backup or archive path. The value is a positive integer with a unit. Supported units are kb, mb, and gb, representing KB/s, MB/s, and GB/s, respectively. If not explicitly set, the bandwidth is not restricted. Example: |
| access_id=new_access_id&access_key=new_access_key | The new access_id and access_key information after the change. Both access_id and access_key must be provided. |
Examples
Change the source endpoint of an archive path
Assume that the original source endpoint of an archive path is zone=z1,z2,z3. Now, you need to change the source endpoint to region=region1. After the change, only nodes in region1 can access this path.
OSS
obclient(root@mysql001)[(none)]> ALTER SYSTEM MODIFY EXTERNAL_STORAGE_DEST PATH='oss://oceanbase-test-bucket/backup/archive?host=****.aliyun-inc.com' SET ATTRIBUTE = 'region=region1';NFS
obclient(root@mysql001)[(none)]> ALTER SYSTEM MODIFY EXTERNAL_STORAGE_DEST PATH='file:///data/nfs/backup/archive' SET ATTRIBUTE = 'region=region1';S3
obclient(root@mysql001)[(none)]> ALTER SYSTEM CHANGE EXTERNAL_STORAGE_DEST PATH='s3://oceanbase-test-bucket/backup/archive?host=s3.<region>.amazonaws.com' SET ATTRIBUTE = 'region=region1';Object storage services that support the S3 protocol (OBS, GCS, and COS)
obclient(root@mysql001)[(none)]> ALTER SYSTEM CHANGE EXTERNAL_STORAGE_DEST PATH='s3://oceanbase-test-bucket/backup/archive?host=obs.****.myhuaweicloud.com' SET ATTRIBUTE = 'region=region1';obclient(root@mysql001)[(none)]> ALTER SYSTEM MODIFY EXTERNAL_STORAGE_DEST PATH='s3://oceanbase-test-bucket/backup/archive?host=https://storage.googleapis.com' SET ATTRIBUTE = 'region=region1';obclient(root@mysql001)[(none)]> ALTER SYSTEM ALTER EXTERNAL_STORAGE_DEST PATH='s3://oceanbase-test-bucket/backup/archive?host=cos.ap-xxxx.myqcloud.com' SET ATTRIBUTE = 'region=region1';
Change the source endpoint of a backup path
Assume that the original source endpoint of a backup path is zone=z1,z2;z3. Now, you need to change the source endpoint to idc=idc1;idc2. After the change, nodes in idc1 and idc2 can access this path. The nodes in idc1 have higher priority than those in idc2.
OSS
obclient(root@mysql001)[(none)]> ALTER SYSTEM CHANGE EXTERNAL_STORAGE_DEST PATH='oss://oceanbase-test-bucket/backup/data?host=****.aliyun-inc.com' SET ATTRIBUTE = 'idc=idc1;idc2';NFS
obclient(root@mysql001)[(none)]> ALTER SYSTEM ALTER EXTERNAL_STORAGE_DEST PATH='file:///data/nfs/backup/data' SET ATTRIBUTE = 'idc=idc1;idc2';S3
obclient(root@mysql001)[(none)]> ALTER SYSTEM MODIFY EXTERNAL_STORAGE_DEST PATH='s3://oceanbase-test-bucket/backup/data?host=s3.<region>.amazonaws.com' SET ATTRIBUTE = 'idc=idc1;idc2';Object storage services that support the S3 protocol (OBS, GCS, and COS)
obclient(root@mysql001)[(none)]> ALTER SYSTEM CHANGE EXTERNAL_STORAGE_DEST PATH='s3://oceanbase-test-bucket/backup/data?host=obs.****.myhuaweicloud.com' SET ATTRIBUTE = 'idc=idc1;idc2';obclient(root@mysql001)[(none)]> ALTER SYSTEM MODIFY EXTERNAL_STORAGE_DEST PATH='s3://oceanbase-test-bucket/backup/data?host=https://storage.googleapis.com' SET ATTRIBUTE = 'idc=idc1;idc2';obclient(root@mysql001)[(none)]> ALTER SYSTEM ALTER EXTERNAL_STORAGE_DEST PATH='s3://oceanbase-test/backup/data?host=cos.ap-xxxx.myqcloud.com' SET ATTRIBUTE = 'idc=idc1;idc2';
Change the access_id and access_key of an archive path
OSS
obclient(root@mysql001)[(none)]> ALTER SYSTEM MODIFY EXTERNAL_STORAGE_DEST PATH='oss://oceanbase-test-bucket/backup/archive?host=****.aliyun-inc.com' SET ACCESS_INFO = 'access_id=******&access_key=******';S3
obclient(root@mysql001)[(none)]> ALTER SYSTEM CHANGE EXTERNAL_STORAGE_DEST PATH='s3://oceanbase-test-bucket/backup/archive?host=s3.<region>.amazonaws.com' SET ACCESS_INFO = 'access_id=******&access_key=******';Object storage services that support the S3 protocol (OBS, GCS, and COS)
obclient(root@mysql001)[(none)]> ALTER SYSTEM CHANGE EXTERNAL_STORAGE_DEST PATH='s3://oceanbase-test-bucket/backup/archive?host=obs.****.myhuaweicloud.com' SET ACCESS_INFO = 'access_id=******&access_key=******';obclient(root@mysql001)[(none)]> ALTER SYSTEM MODIFY EXTERNAL_STORAGE_DEST PATH='s3://oceanbase-test-bucket/backup/archive?host=https://storage.googleapis.com' SET ACCESS_INFO = 'access_id=******&access_key=******';obclient(root@mysql001)[(none)]> ALTER SYSTEM ALTER EXTERNAL_STORAGE_DEST PATH='s3://oceanbase-test-bucket/backup/archive?host=cos.ap-xxxx.myqcloud.com' SET ACCESS_INFO = 'access_id=******&access_key=******';
Change the access_id and access_key of a backup path
OSS
obclient(root@mysql001)[(none)]> ALTER SYSTEM MODIFY EXTERNAL_STORAGE_DEST PATH='oss://oceanbase-test-bucket/backup/data?host=****.aliyun-inc.com' SET ACCESS_INFO = 'access_id=******&access_key=******';S3
obclient(root@mysql001)[(none)]> ALTER SYSTEM CHANGE EXTERNAL_STORAGE_DEST PATH='s3://oceanbase-test-bucket/backup/data?host=s3.<region>.amazonaws.com' SET ACCESS_INFO = 'access_id=******&access_key=******';Object storage services that support the S3 protocol (OBS, GCS, and COS)
obclient(root@mysql001)[(none)]> ALTER SYSTEM MODIFY EXTERNAL_STORAGE_DEST PATH='s3://oceanbase-test-bucket/backup/data?host=obs.****.myhuaweicloud.com' SET ACCESS_INFO = 'access_id=******&access_key=******';obclient(root@mysql001)[(none)]> ALTER SYSTEM ALTER EXTERNAL_STORAGE_DEST PATH='s3://oceanbase-test-bucket/backup/data?host=https://storage.googleapis.com' SET ACCESS_INFO = 'access_id=******&access_key=******';obclient(root@mysql001)[(none)]> ALTER SYSTEM CHANGE EXTERNAL_STORAGE_DEST PATH='s3://oceanbase-test/backup/data?host=cos.ap-xxxx.myqcloud.com' SET ACCESS_INFO = 'access_id=******&access_key=******';
Set I/O throttling parameters (max_iops and max_bandwidth) of an archive path
You can set both the max_iops and max_bandwidth parameters, or set only one of them. You can set I/O throttling parameters only for object storage paths. You cannot set I/O throttling parameters for NFS paths.
OSS
Set both the
max_iopsandmax_bandwidthparameters. Example:obclient(root@mysql001)[(none)]> ALTER SYSTEM MODIFY EXTERNAL_STORAGE_DEST PATH='oss://oceanbase-test-bucket/backup/archive?host=****.aliyun-inc.com' SET ATTRIBUTE = 'max_iops=1000&max_bandwidth=1000mb';Set only the
max_iopsparameter. Example:obclient(root@mysql001)[(none)]> ALTER SYSTEM MODIFY EXTERNAL_STORAGE_DEST PATH='oss://oceanbase-test-bucket/backup/archive?host=****.aliyun-inc.com' SET ATTRIBUTE = 'max_iops=1000';Set only the
max_bandwidthparameter. Example:obclient(root@mysql001)[(none)]> ALTER SYSTEM MODIFY EXTERNAL_STORAGE_DEST PATH='oss://oceanbase-test-bucket/backup/archive?host=****.aliyun-inc.com' SET ATTRIBUTE = 'max_bandwidth=1000mb';S3
Set both the
max_iopsandmax_bandwidthparameters. Example:obclient(root@mysql001)[(none)]> ALTER SYSTEM CHANGE EXTERNAL_STORAGE_DEST PATH='s3://oceanbase-test-bucket/backup/archive?host=s3.<region>.amazonaws.com' SET ATTRIBUTE = 'max_iops=1000&max_bandwidth=1000mb';Object storage services that support the S3 protocol (OBS, GCS, and COS)
Set both the
max_iopsandmax_bandwidthparameters. Example:obclient(root@mysql001)[(none)]> ALTER SYSTEM CHANGE EXTERNAL_STORAGE_DEST PATH='s3://oceanbase-test-bucket/backup/archive?host=obs.****.myhuaweicloud.com' SET ATTRIBUTE = 'max_iops=1000&max_bandwidth=1000mb';obclient(root@mysql001)[(none)]> ALTER SYSTEM MODIFY EXTERNAL_STORAGE_DEST PATH='s3://oceanbase-test-bucket/backup/archive?host=https://storage.googleapis.com' SET ATTRIBUTE = 'max_iops=1000&max_bandwidth=1000mb';obclient(root@mysql001)[(none)]> ALTER SYSTEM ALTER EXTERNAL_STORAGE_DEST PATH='s3://oceanbase-test-bucket/backup/archive?host=cos.ap-xxxx.myqcloud.com' SET ATTRIBUTE = 'max_iops=1000&max_bandwidth=1000mb';
Set I/O throttling parameters for backup paths (max_iops and max_bandwidth)
Note
Consider the following recommendations when you set I/O throttling parameters:
- In a highly concurrent, bandwidth-sensitive multi-tenant environment, you can set different
max_iopsormax_bandwidthvalues for different backup paths to isolate the impact of backup operations on online business bandwidth and IOPS. - We recommend that you start with lower values and gradually adjust them based on your actual network bandwidth and object storage throttling strategy. For example, you can start by setting
max_iops=500&max_bandwidth=100mband then fine-tune the values based on backup duration and business peak times.
You can set both the max_iops and max_bandwidth parameters, or set only one of them. I/O throttling parameters are supported only for object storage paths, not for NFS paths.
OSS
The following example shows how to set both the
max_iopsandmax_bandwidthparameters.obclient(root@mysql001)[(none)]> ALTER SYSTEM MODIFY EXTERNAL_STORAGE_DEST PATH='oss://oceanbase-test-bucket/backup/data?host=****.aliyun-inc.com' SET ATTRIBUTE = 'max_iops=1000&max_bandwidth=1000mb';The following example shows how to set only the
max_iopsparameter.obclient(root@mysql001)[(none)]> ALTER SYSTEM MODIFY EXTERNAL_STORAGE_DEST PATH='oss://oceanbase-test-bucket/backup/data?host=****.aliyun-inc.com' SET ATTRIBUTE = 'max_iops=1000';The following example shows how to set only the
max_bandwidthparameter.obclient(root@mysql001)[(none)]> ALTER SYSTEM MODIFY EXTERNAL_STORAGE_DEST PATH='oss://oceanbase-test-bucket/backup/data?host=****.aliyun-inc.com' SET ATTRIBUTE = 'max_bandwidth=1000mb';S3
The following example shows how to set both the
max_iopsandmax_bandwidthparameters.obclient(root@mysql001)[(none)]> ALTER SYSTEM CHANGE EXTERNAL_STORAGE_DEST PATH='s3://oceanbase-test-bucket/backup/data?host=s3.<region>.amazonaws.com' SET ATTRIBUTE = 'max_iops=1000&max_bandwidth=1000mb';Object storage compatible with the S3 protocol (OBS, GCS, and COS)
The following example shows how to set both the
max_iopsandmax_bandwidthparameters.obclient(root@mysql001)[(none)]> ALTER SYSTEM CHANGE EXTERNAL_STORAGE_DEST PATH='s3://oceanbase-test-bucket/backup/data?host=obs.****.myhuaweicloud.com' SET ATTRIBUTE = 'max_iops=1000&max_bandwidth=1000mb';obclient(root@mysql001)[(none)]> ALTER SYSTEM ALTER EXTERNAL_STORAGE_DEST PATH='s3://oceanbase-test-bucket/backup/data?host=https://storage.googleapis.com' SET ATTRIBUTE = 'max_iops=1000&max_bandwidth=1000mb';obclient(root@mysql001)[(none)]> ALTER SYSTEM MODIFY EXTERNAL_STORAGE_DEST PATH='s3://oceanbase-test/backup/data?host=cos.ap-xxxx.myqcloud.com' SET ATTRIBUTE = 'max_iops=1000&max_bandwidth=1000mb';