OCP allows you to configure personalized backup and restore strategies for each tenant. After you create a tenant-level backup strategy for a tenant, the tenant is no longer affected by the cluster-level backup strategy.
You can create a tenant-level backup strategy by using the following two methods:
Method 1: Log in to the OCP console. In the left-side navigation pane, choose Backup & Recovery > Backups. The Backups page appears.
Method 2: Log in to the OCP console. On the Overview page of the tenant, click Backup & Recovery in the left-side navigation pane. The Backup & Recovery details page appears.
Note
If a cluster-level backup strategy exists for the cluster to which the tenant belongs, the content of the cluster-level backup strategy is automatically filled in when you create a tenant-level backup strategy.
Prerequisites
When you create a tenant-level backup strategy by using Method 1, make sure that the user who logs in to OCP has the following permissions:
- The Cluster Maintenance or Tenant Maintenance resource permission.
- The Backup menu permission under Backup and Recovery.
When you create a tenant-level backup strategy by using Method 2, make sure that the user who logs in to OCP has the following permissions:
- The Cluster Maintenance or Tenant Maintenance resource permission.
- The Backup & Recovery menu permission under Backup and Restore.
A tenant can be created only in a cluster of V4.0.0 or later.
OceanBase Database does not support backing up a locked tenant.
The sys tenant does not support creating a tenant-level backup strategy.
Procedure
The following steps use Method 1 as an example.
In the left-side navigation pane, choose Backup and Recovery > Backups.
On the Backups page, hover the pointer over New Backup Strategy and click Create Tenant-level Backup Strategy.
In the drop-down list, select a tenant to back up.
If the version of the cluster to which the tenant belongs is earlier than V2.2.60, the backup method is Logical Backup.
If the version of the cluster to which the tenant belongs is V2.2.60 or later, the backup method is Physical Backup.
Set the storage configuration and click Test.
For logical backup, select the storage configuration configured in Install a service.
If no backup service is installed, you must install one. For more information, see Install a service.
For physical backup, you can customize or select an existing storage configuration. If you customize the configuration, you must set the parameters as described in the following table. If you select an existing configuration, the parameters in the following table will be automatically populated after you click Select Existing Configuration.
Notice
If native Alibaba Cloud OSS or Tencent Cloud COS is available, we recommend that you use it for configuration.
File: local file storage, which is usually NFS.
Parameter Description Storage Directory The storage directory for backup files on the current media. If a backup recovery strategy already exists for the tenant's cluster, we recommend that you set this directory to be consistent with the cluster. Otherwise, it may affect the statistics of tenant backup data. Backup Storage Capacity Alarm Threshold The alarm threshold for backup storage capacity. The default value is 80%. OSS: Alibaba Cloud OSS, which is supported only by OceanBase Database V2.2.76 and later.
Parameter Description Storage Directory The storage directory for backup files on the current media. If a backup recovery strategy already exists for the tenant's cluster, we recommend that you set this directory to be consistent with the cluster. Otherwise, it may affect the statistics of tenant backup data. Access Domain Name The domain name for accessing the Alibaba Cloud storage endpoint. Example: oss-cn-hangzhou.aliyuncs.com.Access User The user for accessing the Alibaba Cloud storage endpoint. Access Secret The user secret for accessing the Alibaba Cloud storage endpoint. COS: Tencent Cloud COS, which is supported only by OceanBase Database V2.2.76 and later, V4.0 and earlier, or V4.2.1 and later.
Parameter Description Storage Directory The storage directory for backup files on the current media. If a backup recovery strategy already exists for the tenant's cluster, we recommend that you set this directory to be consistent with the cluster. Otherwise, it may affect the statistics of tenant backup data. Access Domain Name The domain name for accessing the objects in the Tencent Cloud COS bucket. Example: cos.ap-beijing.myqcloud.com.Resource Identifier (APPID) The unique resource identifier at the user level for accessing the COS service. You can obtain it on the API key management page of the corresponding service. Project Identity ID The project identity ID of the developer. You can obtain it on the API key management page of the corresponding service. Project Identity Secret The project identity secret of the developer. You can obtain it on the API key management page of the corresponding service. S3: a storage medium that is compatible with the AWS S3 protocol, including native AWS S3, Huawei Cloud OBS, China Telecom Cloud OBS, and Google GCS. OceanBase Database V4.2.1-BP7 and V4.2.3-BP1 (and later) support this feature. For more information about storage media that is compatible with the AWS S3 protocol, see Overview of the S3 protocol.
Parameter Description Storage Directory The storage directory for backup files on the current media. If a backup recovery strategy already exists for the tenant's cluster, we recommend that you set this directory to be consistent with the cluster. Otherwise, it may affect the statistics of tenant backup data. Access Domain Name The domain name for accessing the objects in the S3 storage space (bucket). Example: s3.us-west-2.amazonaws.com.AK The secret ID of the S3 storage space. SK The access secret of the S3 storage space. Region The region of the S3 storage space. Notice
If the storage medium is AWS S3, the Region field is a required field. If the storage medium is Huawei Cloud OBS, China Telecom Cloud OBS, or Google GCS, this field is not required.
(Optional) Enable the custom backup scope feature.
Notice
- Custom backup scope is supported in OceanBase Database V4.2.1.11, V4.2.0, V4.2.5.2, and V4.3.0.
- When a tenant-level backup policy exists, custom backup scope is not supported.
- Data backup reads backup data from the follower replica by default. Log backup reads backup data from the leader replica by default.
- When you select a zone for backup, you must prioritize the zones. Otherwise, backup may fail or cross-region traffic may be generated.
- When you enable the custom backup scope feature, we recommend that you do not set the primary zone to random.
Select the data backup type: zone, region, or IDC, and use the shuttle box to set the priority of the zone, region, or IDC.
Select the log backup type: zone, region, or IDC, and use the shuttle box to set the priority of the zone, region, or IDC.
Set the scheduling configuration.
Scheduling Cycle: The backup schedule is performed on a weekly or monthly basis. If the backup schedule is performed on a monthly basis, you can select at most 10 days.
If you disable log backup for physical backup, the system will start log backup before data backup and disable log backup after data backup is completed.
Set the backup cleanup scheduling configuration.
Set the alarm threshold. You can configure the data backup timeout alarm threshold, log backup latency alarm threshold, and number of days without successful data backup. After the configuration is successful, an alert will be triggered when the actual output exceeds the threshold.
(Optional) Set the secondary backup configuration.
Note
Secondary backup is not supported in OceanBase Database V4.x.
You can choose to back up the backup data files and log files to another directory. To enable secondary backup, turn on the Secondary Backup switch.
Set the storage configuration for secondary backup.
Set the scheduling configuration for secondary backup.
Click Create to create the tenant-level backup policy.